-
Notifications
You must be signed in to change notification settings - Fork 62
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
ci: e2e tests on windows #750
Conversation
b152483
to
ffcedcb
Compare
set -e | ||
|
||
source ./shared-scripts.sh && _setupE2ETestsWindows | ||
codebuild-breakpoint |
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 is keeping the same behavior as E2E tests on linux. I'm not sure codebuild-breakpoint
is strictly needed on either.
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 is used when you want to run the tests in debug mode. I think the script is called yarn-e2e-debug
.
.wait( | ||
'"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud', | ||
) | ||
.wait('"amplify publish" will build all your local backend and frontend resources') |
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.
Strange error.
● codegen remove tests - iOS › Does not delete files during codegen remove
--
351 |
352 | Expected value "\"amplify publish\" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud"
353 | Received:
354 | "ision it in the cloud"
355 |
356 | Message:
357 | expected "ision it in the cloud" to contain "\"amplify publish\" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud"
358 |
359 | Difference:
360 |
361 | - Expected
362 | + Received
363 |
364 | - "amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud
365 | + ision it in the cloud
The message is correct when running manually. Maybe there is a maximum length? The "v" in "provision" is the 120th character.
This change was also made on the CLI E2E when enabling windows.
aws-amplify/amplify-cli@97c6de4
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.
Alternatively, you can wrap the message with */
regex to ignore subsequent parts. Just FYI.
function _scanArtifacts { | ||
if ! yarn ts-node .codebuild/scripts/scan_artifacts.ts; then |
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.
Get an error when using yarn over npx/npm. It looks like there are some workarounds, but it is easier to just use npx/npm here because there will be no functional difference to the scripts.
error Couldn't find the binary C:\codebuild\tmp\output\src2004\src\github.com\aws-amplify\amplify-codegen\node_modules\.bin\ts-node
@@ -7,7 +7,7 @@ function startLocalRegistry { | |||
# Start local registry | |||
tmp_registry_log="$(mktemp)" | |||
echo "Registry output file: $tmp_registry_log" | |||
(cd && nohup npx ${VERDACCIO_PACKAGE:-$default_verdaccio_package} -c $1 &>$tmp_registry_log &) | |||
nohup npx ${VERDACCIO_PACKAGE:-$default_verdaccio_package} -c $1 &>$tmp_registry_log & |
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.
The cd
is unnecessary here and caused some issues on Windows.
@@ -32,7 +32,7 @@ | |||
"jest-circus": "^27.5.1", | |||
"jest-environment-node": "^26.6.2", | |||
"lodash": "^4.17.19", | |||
"node-pty": "beta", | |||
"node-pty": "1.0.0", |
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 might not be necessary for this change. I tried this when troubleshooting various issues. However, this is probably something we should do regardless so that our version is stable. I can try removing this and adding it to a separate change if it is desired.
This reverts commit c425469.
// amplify-configure will always choose us-east-1 for the region. | ||
// This will set all Windows jobs to use us-east-1 to avoid region mismatch. | ||
// We will come back to this later to properly fix the testing issue. | ||
const region = os === 'w' ? 'us-east-1' : AWS_REGIONS_TO_RUN_TESTS[jobIdx % AWS_REGIONS_TO_RUN_TESTS.length]; |
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.
Another weird thing, this only seems to affect the amplify configure
step. On commands like codegen add
the selection is set correctly.
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.
We might need to look into how we're sending the region selection command interactively and make it for both platforms. Running in us-east-1
is fine for now.
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.
It is using j/k to navigate the list. I tried with up/down arrow as well and ran into the same issue. I've created a task to investigate further.
set -e | ||
|
||
source ./shared-scripts.sh && _setupE2ETestsWindows | ||
codebuild-breakpoint |
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 is used when you want to run the tests in debug mode. I think the script is called yarn-e2e-debug
.
.wait( | ||
'"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud', | ||
) | ||
.wait('"amplify publish" will build all your local backend and frontend resources') |
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.
Alternatively, you can wrap the message with */
regex to ignore subsequent parts. Just FYI.
@@ -31,9 +32,10 @@ describe('GraphQL documents generator e2e tests', () => { | |||
}); | |||
|
|||
const schemaFileName = 'schema.graphql'; | |||
it('generates valid GraphQL documents for given schema', async () => { | |||
// skip cypress test on windows | |||
(isWindows() ? it.skip : it)('generates valid GraphQL documents for given schema', async () => { |
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.
Do we want to run these on windows as well eventually? If yes, we should have a task for it.
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've created tasks for the 2 disabled tests and the region issue.
// amplify-configure will always choose us-east-1 for the region. | ||
// This will set all Windows jobs to use us-east-1 to avoid region mismatch. | ||
// We will come back to this later to properly fix the testing issue. | ||
const region = os === 'w' ? 'us-east-1' : AWS_REGIONS_TO_RUN_TESTS[jobIdx % AWS_REGIONS_TO_RUN_TESTS.length]; |
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.
We might need to look into how we're sending the region selection command interactively and make it for both platforms. Running in us-east-1
is fine for now.
Description of changes
Run E2E tests on Windows.
The Windows bash terminal on CodeBuild appears to be non-interactive. This is causing issues with selecting a region when running
amplify configure
. I've set all the Windows E2E tests to runus-east-1
for now and we can fix that later when you have some more time.There are two disabled tests for windows only:
Test 1 is not very valuable. It is possible to do this with the current CLI, but realistically no customer would do this because XCode is not available on windows.
Test 2 is much more valuable. This asserts that the generated graphql statements work in a running app. The app compiles but then there is an error in cypress. It does not appear to be an error in a test case. It might be an issue with cypress on the windows instance.
I was not able to reproduce either case on my own windows workspace.
To recap, we have 3 follow ups to complete later:
Issue #, if available
N/A
Description of how you validated changes
Run the E2E tests.
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.