Skip to content

Commit 7cb97a2

Browse files
fix(ci): e2e test updateDevEnv failing #3357
For some reason the cc backend did not receive at dev env id from our e2e test updateDevEnv api call. This commit verifies we are giving a dev env id before sending the api request. Additional: We used the variable 'global' before it could be properly initialized and due to the order of execution this variable was accessed before it could be properly initialized. To fix this it was moved inside a 'before' block which will ensure it gets executed AFTER all the pre-test hooks are fun, which includes initializing the global variable Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
1 parent f243990 commit 7cb97a2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/testE2E/codecatalyst/client.test.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ describe('Test how this codebase uses the CodeCatalyst API', function () {
132132
})
133133

134134
describe('getThisDevEnv', function () {
135-
const ccAuth = CodeCatalystAuthenticationProvider.fromContext(globals.context)
135+
let ccAuth: CodeCatalystAuthenticationProvider
136+
137+
before(function () {
138+
ccAuth = CodeCatalystAuthenticationProvider.fromContext(globals.context)
139+
})
136140

137141
it('returns `undefined` if not in a dev environment', async function () {
138142
const result = await getThisDevEnv(ccAuth)
@@ -260,6 +264,9 @@ describe('Test how this codebase uses the CodeCatalyst API', function () {
260264
assert.notStrictEqual(defaultDevEnv.alias, newDevEnvSettings.alias)
261265
assert.notStrictEqual(defaultDevEnv.instanceType, newDevEnvSettings.instanceType)
262266

267+
// Sanity Check due to: https://issues.amazon.com/Velox-Bug-42
268+
assert.ok(defaultDevEnv.id, 'Dev Env ID should not be empty.')
269+
263270
// Update dev env
264271
const updatedDevEnv = await commands.updateDevEnv(defaultDevEnv, newDevEnvSettings)
265272

@@ -334,6 +341,7 @@ describe('Test how this codebase uses the CodeCatalyst API', function () {
334341
instanceType,
335342
persistentStorage,
336343
alias: createAlias(),
344+
inactivityTimeoutMinutes: 15,
337345
}
338346
}
339347

0 commit comments

Comments
 (0)