Skip to content

Commit

Permalink
Mark remaining flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RXminuS committed Oct 22, 2024
1 parent 47f37f8 commit e4d6843
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
19 changes: 16 additions & 3 deletions vscode/e2e/features/command-edit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ test.describe('edit command', {}, () => {

// TODO(@RXminuS): #flake There's some flake here as the selection range is dependent on the
// indexing status of the file within Cody
test.fixme(
test(
'can change edit ranges',
{ tag: ['@flaky'] },
async ({ workspaceDir, page, vscodeUI, mitmProxy, polly, context }, testInfo) => {
const { vsc } = await uix.vscode.Session.startWithCody(
{ page, vscodeUI, workspaceDir, polly },
Expand All @@ -138,15 +139,27 @@ test.describe('edit command', {}, () => {
workspaceFile: 'type.ts',
selection: { start: { line: 2, col: 1 }, end: { line: 3, col: 1 } },
})
await expect(selectionStatus).toHaveText('Ln 3, Col 1 (22 selected)')
try {
await expect(selectionStatus).toHaveText('Ln 3, Col 1 (22 selected)')
} catch (e) {
console.error(e)
testInfo.fixme()
return
}

await vsc.runCommand({ command: 'cody.command.edit-code', skipResult: true })

// TODO: There seems to be some flake because the document isn't indexed yet?
// Just run this test with retry-each 10 and about 10% should fail.
await vsc.QuickPick.items({ hasText: /Range/ }).click()
await vsc.QuickPick.items({ hasText: /Selection/ }).click()
await expect(selectionStatus).toHaveText('Ln 3, Col 21 (38 selected)')
try {
await expect(selectionStatus).toHaveText('Ln 3, Col 21 (38 selected)')
} catch (e) {
console.error(e)
testInfo.fixme()
return
}

// We now change to code-block
await vsc.QuickPick.items({ hasText: /Range/ }).click()
Expand Down
16 changes: 11 additions & 5 deletions vscode/e2e/telemetry/at-mention.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fixture as test, uix } from '../utils/vscody'
import { expect } from '../utils/vscody/uix'

test.describe('cody.at-mention', () => {
test.describe('cody.at-mention', { tag: ['@flaky'] }, () => {
const repoVariants: Array<'public' | 'private'> = ['public', 'private'] as const
const endpointVariants: Array<'dotcom' | 'enterprise'> = ['dotcom', 'enterprise'] as const

Expand Down Expand Up @@ -112,18 +112,24 @@ test.describe('cody.at-mention', () => {
selectTelemetry.filter({ matching: { feature: 'cody.at-mention' } }),
'No additional at-mention events to fire on actual selection'
).toEqual([])
await expect
.soft(

//TODO(@RXminuS): #flake We need a way of ensuring Git is initialized before we hit this
try {
await expect(
// .soft(
selectTelemetry.filter({
matching: [{ feature: 'cody.chat-question' }],
})
)
.toMatchJSONSnapshot(
).toMatchJSONSnapshot(
`responseRecievedEvents.${endpointVariant}.${repoVariant}`,
{
normalizers: snapshotNormalizers,
}
)
} catch (e) {
console.error(e)
testInfo.fixme()
}
})
}
)
Expand Down

0 comments on commit e4d6843

Please sign in to comment.