-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test): add flags to identify and stub Mesos requests
Add flags (query parameters) to identify and stub Mesos Operator API requests to fix the integration tests that were otherwise failing or flaky due to parsing errors in the `MesosStateStore`. The store failed to parse the `GET_MASTER` response as we could only register one stub for both the `GET_MASTER` and `SUBSCRIBE` requests resulting in JSON parse errors due to the different response formats (RecoredIO<JSON>, JSON). The flags are necessary as Cypress can only stub requests based on the URL and request method and doesn't provide the means to dynamically stub requests based on the payload as documented in cypress-io/cypress#521. We will remove the flags once the Cypress team rewrote the network handling and added support for dynamic stubs as documented in cypress-io/cypress#687 or we've addressed https://jira.mesosphere.com/browse/DCOS_OSS-2021.
- Loading branch information
Orlando Hohmeier
committed
Jan 2, 2018
1 parent
4151f5f
commit 022ddfb
Showing
9 changed files
with
259 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import { stream } from "@dcos/mesos-client"; | ||
|
||
export const MesosStreamType = Symbol("MesosStreamType"); | ||
export default stream({ type: "SUBSCRIBE" }).publishReplay().refCount(); | ||
export default stream({ type: "SUBSCRIBE" }, "/mesos/api/v1?subscribe") | ||
.publishReplay() | ||
.refCount(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/_fixtures/1-service-with-executor-task/mesos-get-master.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"get_master": { | ||
"master_info": { | ||
"address": { | ||
"hostname": "10.0.7.122", | ||
"ip": "10.0.7.122", | ||
"port": 5050 | ||
}, | ||
"capabilities": [ | ||
{ | ||
"type": "AGENT_UPDATE" | ||
} | ||
], | ||
"domain": { | ||
"fault_domain": { | ||
"region": { | ||
"name": "region-1" | ||
}, | ||
"zone": { | ||
"name": "zone-1" | ||
} | ||
} | ||
}, | ||
"hostname": "10.0.7.122", | ||
"id": "b3bd182c-c6d7-463e-8bf0-06cd5807df4e", | ||
"ip": 2198274058, | ||
"pid": "[email protected]:5050", | ||
"port": 5050, | ||
"version": "0.27.0" | ||
} | ||
}, | ||
"type": "GET_MASTER" | ||
} |
File renamed without changes.
33 changes: 33 additions & 0 deletions
33
tests/_fixtures/healthy-tasks-in-mesos-and-marathon/mesos-get-master.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"get_master": { | ||
"master_info": { | ||
"address": { | ||
"hostname": "10.0.4.58", | ||
"ip": "10.0.4.58", | ||
"port": 5050 | ||
}, | ||
"capabilities": [ | ||
{ | ||
"type": "AGENT_UPDATE" | ||
} | ||
], | ||
"domain": { | ||
"fault_domain": { | ||
"region": { | ||
"name": "region-1" | ||
}, | ||
"zone": { | ||
"name": "zone-1" | ||
} | ||
} | ||
}, | ||
"hostname": "10.0.4.58", | ||
"id": "74f1836b-6784-4030-816e-aacbdd45ff57", | ||
"ip": 2198274058, | ||
"pid": "[email protected]:5050", | ||
"port": 5050, | ||
"version": "1.2.0" | ||
} | ||
}, | ||
"type": "GET_MASTER" | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"get_master": { | ||
"master_info": { | ||
"address": { | ||
"hostname": "172.17.8.101", | ||
"ip": "172.17.8.101", | ||
"port": 5050 | ||
}, | ||
"capabilities": [ | ||
{ | ||
"type": "AGENT_UPDATE" | ||
} | ||
], | ||
"domain": { | ||
"fault_domain": { | ||
"region": { | ||
"name": "region-1" | ||
}, | ||
"zone": { | ||
"name": "zone-1" | ||
} | ||
} | ||
}, | ||
"hostname": "172.17.8.101", | ||
"id": "20151004-214809-1695027628-5050-12268", | ||
"ip": 2198274058, | ||
"pid": "[email protected]:5050", | ||
"port": 5050, | ||
"version": "0.23.0" | ||
} | ||
}, | ||
"type": "GET_MASTER" | ||
} |
File renamed without changes.
Oops, something went wrong.