Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez committed Sep 30, 2024
1 parent 080a4cb commit 84754ec
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions integration-tests/cucumber/cucumber.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,7 @@ versions.forEach(version => {
const testSession = events.find(event => event.type === 'test_session_end').content
assert.notProperty(testSession.meta, TEST_EARLY_FLAKE_ENABLED)
assert.propertyVal(testSession.meta, TEST_EARLY_FLAKE_ABORT_REASON, 'faulty')
assert.propertyVal(testSession.meta, CUCUMBER_IS_PARALLEL, 'true')

const tests = events.filter(event => event.type === 'test').map(event => event.content)

Expand All @@ -1290,6 +1291,59 @@ versions.forEach(version => {
}).catch(done)
})
})

it('does not retry tests that are skipped', (done) => {
const NUM_RETRIES_EFD = 3
receiver.setSettings({
itr_enabled: false,
code_coverage: false,
tests_skipping: false,
early_flake_detection: {
enabled: true,
slow_test_retries: {
'5s': NUM_RETRIES_EFD
}
}
})
// "cucumber.ci-visibility/features/farewell.feature.Say whatever" will be considered new
// "cucumber.ci-visibility/features/greetings.feature.Say skip" will be considered new
receiver.setKnownTests({
cucumber: {
'ci-visibility/features/farewell.feature': ['Say farewell'],
'ci-visibility/features/greetings.feature': ['Say greetings', 'Say yeah', 'Say yo']
}
})

const eventsPromise = receiver
.gatherPayloadsMaxTimeout(({ url }) => url.endsWith('/api/v2/citestcycle'), payloads => {
const events = payloads.flatMap(({ payload }) => payload.events)

const testSession = events.find(event => event.type === 'test_session_end').content
assert.propertyVal(testSession.meta, TEST_EARLY_FLAKE_ENABLED, 'true')
assert.propertyVal(testSession.meta, CUCUMBER_IS_PARALLEL, 'true')
const tests = events.filter(event => event.type === 'test').map(event => event.content)

const skippedNewTest = tests.filter(test =>
test.resource === 'ci-visibility/features/greetings.feature.Say skip'
)
// not retried
assert.equal(skippedNewTest.length, 1)
})

childProcess = exec(
parallelModeCommand,
{
cwd,
env: envVars,
stdio: 'pipe'
}
)
childProcess.on('exit', () => {
eventsPromise.then(() => {
done()
}).catch(done)
})
})
})
}
})
Expand Down

0 comments on commit 84754ec

Please sign in to comment.