-
Notifications
You must be signed in to change notification settings - Fork 575
test(amazonq): add more tests for /transform #6183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
authType = 'awsId' | ||
} | ||
return authType | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This above function was previously in transformApiHandler.ts
, just moving it here so it's in a shared utils file
assert.strictEqual(usesHttpsAndExpiresAfter60Seconds, true) | ||
}) | ||
|
||
it('WHEN zipCode THEN ZIP contains all expected files and no unexpected files', async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this test to the file above with the other zipCode
tests
@@ -35,10 +34,6 @@ describe('transformByQ', async function () { | |||
await fs.writeFile(tempFilePath, 'sample content for the test file') | |||
transformByQState.setProjectPath(tempDir) | |||
const zipCodeResult = await zipCode({ | |||
dependenciesFolder: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used for these tests
packages/core/src/testE2E/amazonQTransform/transformByQ.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How often will these tests be run & do they have to be manually triggered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/runIntegrationTests to trigger them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are also run automatically after merging.
|
||
describe('Starting a transformation from chat', () => { | ||
it('Can click through all user input forms for a Java upgrade', async () => { | ||
sinon.stub(startTransformByQ, 'getValidSQLConversionCandidateProjects').resolves([]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stub some validation-related logic in this test file because 1) we already have unit test coverage of those, and 2) these tests are just as useful even with mocked validation functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but when things change in the implementation (e.g. using Flare), stubs/mocks will break easily. Thanks for calling this out in any case.
@@ -6,4 +6,7 @@ | |||
export { activate } from './activation' | |||
export { default as DependencyVersions } from './models/dependencies' | |||
export { default as MessengerUtils } from './chat/controller/messenger/messengerUtils' | |||
export { GumbyController } from './chat/controller/controller' | |||
export { TabsStorage } from '../amazonq/webview/ui/storages/tabsStorage' | |||
export * as startTransformByQ from '../../src/codewhisperer/commands/startTransformByQ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unable to run the tests in packages/amazonq/test/e2e/amazonq/transformByQ.test.ts
by importing these things from the core
module directly where they're defined, as I get an import error when doing that. So instead I have to export them here and then (in the test file, line 11) import them from here.
/runIntegrationTests |
/runIntegrationTests |
/runIntegrationTests |
/runIntegrationTests |
/runIntegrationTests |
/runIntegrationTests |
/runIntegrationTests |
|
||
before(async function () { | ||
await using(registerAuthHook('amazonq-test-account'), async () => { | ||
await loginToIdC() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 if these tests are using the actual service, then e2e is the right place for them.
Problem
/transform
could benefit from more test coverage.Solution
Add tests.
feature/x
branches will not be squash-merged at release time.License: I confirm that my contribution is made under the terms of the Apache 2.0 license.