Fixed broken integration tests on windows.
A number of marathon tests were failing on windows and blocking PRs from being merged. After looking at the tests and fixing them, it's not clear how they were ever working (even on linux/mac). I've updated them to be more stable both on linux/mac and on windows.
This commit is contained in:
parent
bedd260e47
commit
6ec07dfa53
|
@ -7,7 +7,7 @@
|
|||
"type": "DOCKER",
|
||||
"docker": {
|
||||
"image": "busybox",
|
||||
"network": "host"
|
||||
"network": "bogus"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,5 +34,5 @@
|
|||
"id": "moregroups"
|
||||
}
|
||||
],
|
||||
"id": "test-group"
|
||||
"id": "/test-group"
|
||||
}
|
||||
|
|
|
@ -26,5 +26,5 @@
|
|||
"id": "moregroups"
|
||||
}
|
||||
],
|
||||
"id": "test-group"
|
||||
"id": "/test-group"
|
||||
}
|
||||
|
|
|
@ -11,5 +11,5 @@
|
|||
"id": "sleep"
|
||||
}
|
||||
],
|
||||
"id": "test-group"
|
||||
"id": "/test-group"
|
||||
}
|
||||
|
|
|
@ -11,5 +11,5 @@
|
|||
"id": "sleep"
|
||||
}
|
||||
],
|
||||
"id": "scale-group"
|
||||
"id": "/scale-group"
|
||||
}
|
||||
|
|
|
@ -246,18 +246,8 @@ def test_update_bad_type():
|
|||
['dcos', 'marathon', 'app', 'update',
|
||||
'zero-instance-app', 'cpus="a string"'])
|
||||
|
||||
stderr_end = b"""{
|
||||
"details": [
|
||||
{
|
||||
"errors": [
|
||||
"error.expected.jsnumber"
|
||||
],
|
||||
"path": "/cpus"
|
||||
}
|
||||
],
|
||||
"message": "Invalid JSON"
|
||||
}
|
||||
"""
|
||||
stderr_end = b"""{"message":"Invalid JSON","details":[{"path":"/cpus","errors":["error.expected.jsnumber"]}]}""" # noqa: E501
|
||||
|
||||
assert returncode == 1
|
||||
assert stderr_end in stderr
|
||||
assert stdout == b''
|
||||
|
@ -282,24 +272,11 @@ def test_app_add_invalid_request():
|
|||
returncode, stdout, stderr = exec_command(
|
||||
['dcos', 'marathon', 'app', 'add', path])
|
||||
|
||||
assert returncode == 1
|
||||
assert stdout == b''
|
||||
assert re.match(b"Error on request \[POST .*\]: HTTP 400: Bad Request:",
|
||||
stderr)
|
||||
stderr_end = b"""{"message":"Invalid JSON","details":[{"path":"/container/docker/network","errors":["error.unknown.enum.literal"]}]}""" # noqa: E501
|
||||
|
||||
stderr_end = b"""{
|
||||
"details": [
|
||||
{
|
||||
"errors": [
|
||||
"host is not a valid network type"
|
||||
],
|
||||
"path": "/container/docker/network"
|
||||
}
|
||||
],
|
||||
"message": "Invalid JSON"
|
||||
}
|
||||
"""
|
||||
assert stderr.endswith(stderr_end)
|
||||
assert returncode == 1
|
||||
assert stderr_end in stderr
|
||||
assert stdout == b''
|
||||
|
||||
|
||||
def test_update_app():
|
||||
|
|
|
@ -41,21 +41,11 @@ def test_add_bad_complicated_group():
|
|||
['dcos', 'marathon', 'group', 'add'],
|
||||
stdin=fd)
|
||||
|
||||
err = b"""{
|
||||
"details": [
|
||||
{
|
||||
"errors": [
|
||||
"error.path.missing"
|
||||
],
|
||||
"path": "/groups(0)/apps(0)/id"
|
||||
}
|
||||
],
|
||||
"message": "Invalid JSON"
|
||||
}
|
||||
"""
|
||||
stderr_end = b"""{"message":"Invalid JSON","details":[{"path":"/groups(0)/apps(0)/id","errors":["\'id\' is undefined on object: {}"]}]}""" # noqa: E501
|
||||
|
||||
assert returncode == 1
|
||||
assert stderr_end in stderr
|
||||
assert stdout == b''
|
||||
assert err in stderr
|
||||
|
||||
|
||||
def test_update_group_from_stdin():
|
||||
|
|
Loading…
Reference in New Issue