Skip to content

Commit edb3802

Browse files
committed
Remove obsolete testing function
1 parent 94b4014 commit edb3802

File tree

5 files changed

+11
-16
lines changed

5 files changed

+11
-16
lines changed

packages/core/src/testE2E/codewhisperer/referenceTracker.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
import assert from 'assert'
77
import * as codewhispererClient from '../../codewhisperer/client/codewhisperer'
88
import { ConfigurationEntry } from '../../codewhisperer/models/model'
9-
import { setValidConnection, skipTestIfNoValidConn } from '../util/connection'
9+
import { skipTestIfNoValidConn } from '../util/connection'
1010
import { RecommendationHandler } from '../../codewhisperer/service/recommendationHandler'
1111
import { createMockTextEditor, resetCodeWhispererGlobalVariables } from '../../test/codewhisperer/testUtil'
1212
import { invokeRecommendation } from '../../codewhisperer/commands/invokeRecommendation'
1313
import { session } from '../../codewhisperer/util/codeWhispererSession'
14+
import { AuthUtil } from '../../codewhisperer/util/authUtil'
1415

1516
/*
1617
New model deployment may impact references returned.
@@ -49,7 +50,7 @@ describe('CodeWhisperer service invocation', async function () {
4950
}
5051

5152
before(async function () {
52-
validConnection = await setValidConnection()
53+
validConnection = AuthUtil.instance.isConnected()
5354
})
5455

5556
beforeEach(function () {

packages/core/src/testE2E/codewhisperer/securityScan.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as codewhispererClient from '../../codewhisperer/client/codewhisperer'
99
import * as CodeWhispererConstants from '../../codewhisperer/models/constants'
1010
import * as path from 'path'
1111
import * as testutil from '../../test/testUtil'
12-
import { setValidConnection, skipTestIfNoValidConn } from '../util/connection'
12+
import { skipTestIfNoValidConn } from '../util/connection'
1313
import { resetCodeWhispererGlobalVariables } from '../../test/codewhisperer/testUtil'
1414
import { getTestWorkspaceFolder } from '../../testInteg/integrationTestsUtilities'
1515
import { closeAllEditors } from '../../test/testUtil'
@@ -23,6 +23,7 @@ import { makeTemporaryToolkitFolder } from '../../shared/filesystemUtilities'
2323
import fs from '../../shared/fs/fs'
2424
import { ZipUtil } from '../../codewhisperer/util/zipUtil'
2525
import { randomUUID } from '../../shared/crypto'
26+
import { AuthUtil } from '../../codewhisperer'
2627

2728
const filePromptWithSecurityIssues = `from flask import app
2829
@@ -53,7 +54,7 @@ describe('CodeWhisperer security scan', async function () {
5354
const workspaceFolder = getTestWorkspaceFolder()
5455

5556
before(async function () {
56-
validConnection = await setValidConnection()
57+
validConnection = AuthUtil.instance.isConnected()
5758
})
5859

5960
beforeEach(function () {

packages/core/src/testE2E/codewhisperer/serviceInvocations.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import assert from 'assert'
77
import * as vscode from 'vscode'
88
import * as path from 'path'
9-
import { setValidConnection, skipTestIfNoValidConn } from '../util/connection'
9+
import { skipTestIfNoValidConn } from '../util/connection'
1010
import { ConfigurationEntry } from '../../codewhisperer/models/model'
1111
import * as codewhispererClient from '../../codewhisperer/client/codewhisperer'
1212
import { RecommendationHandler } from '../../codewhisperer/service/recommendationHandler'
@@ -20,6 +20,7 @@ import { sleep } from '../../shared/utilities/timeoutUtils'
2020
import { invokeRecommendation } from '../../codewhisperer/commands/invokeRecommendation'
2121
import { getTestWorkspaceFolder } from '../../testInteg/integrationTestsUtilities'
2222
import { session } from '../../codewhisperer/util/codeWhispererSession'
23+
import { AuthUtil } from '../../codewhisperer/util/authUtil'
2324

2425
describe('CodeWhisperer service invocation', async function () {
2526
let validConnection: boolean
@@ -32,7 +33,7 @@ describe('CodeWhisperer service invocation', async function () {
3233
}
3334

3435
before(async function () {
35-
validConnection = await setValidConnection()
36+
validConnection = AuthUtil.instance.isConnected()
3637
})
3738

3839
beforeEach(function () {

packages/core/src/testE2E/util/connection.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { AuthUtil } from '../../codewhisperer'
7-
86
/*
97
In order to run codewhisperer or gumby integration tests user must:
108
@@ -15,10 +13,6 @@ Test cases will skip if the above criteria are not met.
1513
If user has an expired connection they must reauthenticate prior to running tests.
1614
*/
1715

18-
export async function setValidConnection() {
19-
return AuthUtil.instance.isConnected()
20-
}
21-
2216
export function skipTestIfNoValidConn(validConnection: boolean, ctx: Mocha.Context) {
2317
if (!validConnection && ctx.currentTest) {
2418
ctx.currentTest.title += ` (skipped - no valid connection)`

packages/core/src/testInteg/amazonQTransform/transformByQ.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@ import request from '../../shared/request'
1313
import { transformByQState, ZipManifest } from '../../codewhisperer/models/model'
1414
import globals from '../../shared/extensionGlobals'
1515
import { fs } from '../../shared'
16-
import { setValidConnection } from '../../testE2E/util/connection'
16+
import { AuthUtil } from '../../codewhisperer/util/authUtil'
1717

1818
describe('transformByQ', async function () {
1919
let tempDir = ''
2020
let tempFileName = ''
2121
let tempFilePath = ''
2222
let zippedCodePath = ''
23-
let validConnection: boolean
2423

2524
before(async function () {
26-
validConnection = await setValidConnection()
27-
if (!validConnection) {
25+
if (!AuthUtil.instance.isConnected()) {
2826
this.skip()
2927
}
3028
tempDir = path.join(os.tmpdir(), 'gumby-test')

0 commit comments

Comments
 (0)