Commit eea7af4a authored by Ivan Tyagov's avatar Ivan Tyagov

Remove execution-time which can vary from machine to machine.

@luke , As we discussed. Merging dierctly.

Tests passing in
https://nexedi.erp5.net/test_result_module/20200117-9F5C0733

/reviewed-on nexedi/slapos.core!181
parent fca0a727
...@@ -198,7 +198,6 @@ class RunPromise(GenericPromise): ...@@ -198,7 +198,6 @@ class RunPromise(GenericPromise):
if not expected_history: if not expected_history:
expected_history = """{ expected_history = """{
"data": [{ "data": [{
"execution-time": 0.05,
"failed": false, "failed": false,
"message": "success", "message": "success",
"name": "%(name)s.py", "name": "%(name)s.py",
...@@ -215,6 +214,10 @@ class RunPromise(GenericPromise): ...@@ -215,6 +214,10 @@ class RunPromise(GenericPromise):
for entry in result_dict["data"]: for entry in result_dict["data"]:
d = entry.pop("date") d = entry.pop("date")
self.assertEqual(d, entry.pop("change-date")) self.assertEqual(d, entry.pop("change-date"))
# execution time of a promise can vary from 0.05 to 0.2 in a busy test machine
# it makes no sense to test it
execution_time = entry.pop("execution-time")
self.assertTrue(execution_time > 0.0 and execution_time <=1.0)
expected_dict = expected_history % {'name': name} expected_dict = expected_history % {'name': name}
self.assertEqual(json.loads(expected_dict), result_dict) self.assertEqual(json.loads(expected_dict), result_dict)
...@@ -449,14 +452,12 @@ class RunPromise(GenericPromise): ...@@ -449,14 +452,12 @@ class RunPromise(GenericPromise):
self.assertSuccessResult("my_promise") self.assertSuccessResult("my_promise")
self.assertSuccessHistoryResult("my_promise", expected_history = """{ self.assertSuccessHistoryResult("my_promise", expected_history = """{
"data": [{ "data": [{
"execution-time": 0.05,
"failed": false, "failed": false,
"message": "success", "message": "success",
"name": "%(name)s.py", "name": "%(name)s.py",
"status": "OK", "status": "OK",
"title": "%(name)s" "title": "%(name)s"
},{ },{
"execution-time": 0.05,
"failed": false, "failed": false,
"message": "success", "message": "success",
"status": "OK" "status": "OK"
...@@ -493,14 +494,12 @@ class RunPromise(GenericPromise): ...@@ -493,14 +494,12 @@ class RunPromise(GenericPromise):
self.assertSuccessHistoryResult("my_promise", expected_history = """{ self.assertSuccessHistoryResult("my_promise", expected_history = """{
"data": [{ "data": [{
"execution-time": 0.05,
"failed": false, "failed": false,
"message": "success", "message": "success",
"name": "%(name)s.py", "name": "%(name)s.py",
"status": "OK", "status": "OK",
"title": "%(name)s" "title": "%(name)s"
},{ },{
"execution-time": 0.05,
"failed": true, "failed": true,
"message": "failed", "message": "failed",
"status": "ERROR" "status": "ERROR"
...@@ -536,19 +535,16 @@ class RunPromise(GenericPromise): ...@@ -536,19 +535,16 @@ class RunPromise(GenericPromise):
self.maxDiff = None self.maxDiff = None
self.assertSuccessHistoryResult("my_promise", expected_history = """{ self.assertSuccessHistoryResult("my_promise", expected_history = """{
"data": [{ "data": [{
"execution-time": 0.05,
"failed": false, "failed": false,
"message": "success", "message": "success",
"name": "%(name)s.py", "name": "%(name)s.py",
"status": "OK", "status": "OK",
"title": "%(name)s" "title": "%(name)s"
},{ },{
"execution-time": 0.05,
"failed": true, "failed": true,
"message": "failed", "message": "failed",
"status": "ERROR" "status": "ERROR"
},{ },{
"execution-time": 0.05,
"failed": false, "failed": false,
"message": "success", "message": "success",
"status": "OK" "status": "OK"
...@@ -685,7 +681,6 @@ class RunPromise(GenericPromise): ...@@ -685,7 +681,6 @@ class RunPromise(GenericPromise):
self.assertSuccessHistoryResult("my_promise") self.assertSuccessHistoryResult("my_promise")
self.assertSuccessHistoryResult("my_failed_promise", expected_history = """{ self.assertSuccessHistoryResult("my_failed_promise", expected_history = """{
"data": [{ "data": [{
"execution-time": 0.05,
"failed": true, "failed": true,
"message": "failed", "message": "failed",
"name": "%(name)s.py", "name": "%(name)s.py",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment