1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-26 09:57:23 +03:00

M #-: Fix for Go Travis tests (#3742)

This commit is contained in:
Christian González 2019-09-19 19:26:24 +02:00 committed by Tino Vázquez
parent a2f86699b8
commit c185bebb57
2 changed files with 6 additions and 9 deletions

View File

@ -14,9 +14,6 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
# temporarily disabling Go Tests until hook issue is resolved
exit 0
# walk to goca path
cd src/oca/go/src/goca

View File

@ -78,7 +78,7 @@ func TestHook(t *testing.T) {
}
// Check execution records
currentExecs := len(hook.HookLog)
currentExecs := len(hook.Log.ExecutionRecords)
//triger the hook
testCtrl.Zone(0).Info()
@ -87,24 +87,24 @@ func TestHook(t *testing.T) {
hook, err = hookC.Info()
if (len(hook.HookLog) <= currentExecs) {
if (len(hook.Log.ExecutionRecords) <= currentExecs) {
t.Errorf("Hook have not been triggered")
}
// Check retry functionality
currentExecs = len(hook.HookLog)
currentExecs = len(hook.Log.ExecutionRecords)
hookC.Retry(hook.HookLog[0].ExecId)
hookC.Retry(hook.Log.ExecutionRecords[0].ExecId)
time.Sleep(2 * time.Second)
hook, err = hookC.Info()
if (len(hook.HookLog) <= currentExecs) {
if (len(hook.Log.ExecutionRecords) <= currentExecs) {
t.Errorf("Hook execution have not been retried")
}
if (hook.HookLog[len(hook.HookLog) -1].Retry != "yes") {
if (hook.Log.ExecutionRecords[len(hook.Log.ExecutionRecords) -1].Retry != "yes") {
t.Errorf("Hook execution have not been retried")
}