Skip to content

Commit

Permalink
test(codewhisperer): disable Auto Scan after test case #6122
Browse files Browse the repository at this point in the history
## Problem
fix #6078 

## Solution
Turn off CodeWhisper scanning after test suite completes.
  • Loading branch information
roger-zhangg authored Dec 2, 2024
1 parent 591dc9a commit d4b0ede
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { ChildProcess } from '../../../shared/utilities/processUtils'
import { assertTelemetryCurried } from '../../testUtil'
import { HttpResourceFetcher } from '../../../shared/resourcefetcher/httpResourceFetcher'
import { SamCliInfoInvocation } from '../../../shared/sam/cli/samCliInfo'
import { CodeScansState } from '../../../codewhisperer'

interface TestScenario {
toolID: AwsClis
Expand Down Expand Up @@ -81,6 +82,12 @@ const scenarios: TestScenario[] = [
]

describe('AppBuilder Walkthrough', function () {
before(async function () {
// ensure auto scan is disabled before testrun
await CodeScansState.instance.setScansEnabled(false)
assert.strictEqual(CodeScansState.instance.isScansEnabled(), false)
})

describe('Reopen template after reload', function () {
let sandbox: sinon.SinonSandbox
let spyExecuteCommand: sinon.SinonSpy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ describe('CodeWhisperer-basicCommands', function () {
sinon.restore()
})

after(async function () {
// disable auto scan after testrun
await CodeScansState.instance.setScansEnabled(false)
assert.strictEqual(CodeScansState.instance.isScansEnabled(), false)
})

describe('toggleCodeSuggestion', function () {
class TestCodeSuggestionsState extends CodeSuggestionsState {
public constructor(initialState?: boolean) {
Expand Down

0 comments on commit d4b0ede

Please sign in to comment.