Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci-visibility] Test skipping logic for cypress #3167

Merged
merged 8 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions integration-tests/ci-visibility-intake.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,13 @@ class FakeCiVisIntake extends FakeAgent {
})
}

async stop () {
await super.stop()
stop () {
settings = DEFAULT_SETTINGS
suitesToSkip = DEFAULT_SUITES_TO_SKIP
gitUploadStatus = DEFAULT_GIT_UPLOAD_STATUS
infoResponse = DEFAULT_INFO_RESPONSE
this.removeAllListeners()
return super.stop()
}

// Similar to gatherPayloads but resolves if enough payloads have been gathered
Expand Down Expand Up @@ -230,7 +231,7 @@ class FakeCiVisIntake extends FakeAgent {
}, timeout || 15000)
const messageHandler = (message) => {
if (!payloadMatch || payloadMatch(message)) {
clearInterval(timeoutId)
clearTimeout(timeoutId)
resolve(message)
this.off('message', messageHandler)
}
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/ci-visibility.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ testFrameworks.forEach(({
receiver.assertPayloadReceived(() => {
const error = new Error('it should not report code coverage')
done(error)
}, ({ url }) => url === '/api/v2/citestcov')
}, ({ url }) => url === '/api/v2/citestcov').catch(() => {})

receiver.assertPayloadReceived(({ headers, payload }) => {
assert.propertyVal(headers, 'dd-api-key', '1')
Expand Down Expand Up @@ -774,7 +774,7 @@ testFrameworks.forEach(({
receiver.assertPayloadReceived(() => {
const error = new Error('it should not report code coverage')
done(error)
}, ({ url }) => url === '/evp_proxy/v2/api/v2/citestcov')
}, ({ url }) => url === '/evp_proxy/v2/api/v2/citestcov').catch(() => {})

receiver.assertPayloadReceived(({ headers, payload }) => {
assert.notProperty(headers, 'dd-api-key')
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/cucumber/cucumber.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ versions.forEach(version => {
receiver.assertPayloadReceived(() => {
const error = new Error('it should not report code coverage')
done(error)
}, ({ url }) => url.endsWith('/api/v2/citestcov'))
}, ({ url }) => url.endsWith('/api/v2/citestcov')).catch(() => {})

receiver.assertPayloadReceived(({ payload }) => {
const eventTypes = payload.events.map(event => event.type)
Expand Down
3 changes: 2 additions & 1 deletion integration-tests/cypress-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"screenshotOnRunFailure": false,
"pluginsFile": "cypress/plugins-old/index.js",
"supportFile": "cypress/support/e2e.js",
"integrationFolder": "cypress/e2e"
"integrationFolder": "cypress/e2e",
"defaultCommandTimeout": 100
}
1 change: 1 addition & 0 deletions integration-tests/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
defaultCommandTimeout: 100,
e2e: {
setupNodeEvents (on, config) {
require('dd-trace/ci/cypress/plugin')(on, config)
Expand Down
Loading