-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(integ-runner): support --language
presets for JavaScript, TypeScript, Python and Go
#22058
Conversation
@Mergifyio update |
✅ Branch has been successfully updated |
2b3d688
to
be513c7
Compare
be513c7
to
6afa4c7
Compare
b48d2fa
to
e18a78b
Compare
--language
presets in integ-runner
--language
presets in integ-runner--language
presets
e90f498
to
47e1534
Compare
47e1534
to
0601279
Compare
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 pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.
18364d3
to
0b6d427
Compare
Replaces #22927 |
6af5c14
to
3a6057c
Compare
Unsupported languages du to lack of testing {
// works but it's a bit ugly to need to have a project per test case - is there a better solution?
csharp: ['dotnet run --project {filePath}', ['^Integ.*\\.csproj$']],
fsharp: ['dotnet run --project {filePath}', ['^Integ.*\\.fsproj$']],
// untested, but should be working
go: ['go mod download && go run {filePath}', ['^integ_.*\\.go$']],
// this doesn't work. See previous PR attempts for ideas
java: ['mvn -e -q compile exec:java', ['^Integ.*\\.java$']],
} |
0a745b2
to
f40bd8f
Compare
d3cb979
to
f40bd8f
Compare
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.
Awesome!!
test('cannot use --test-regex by itself with more than one language preset', async () => { | ||
await expect(() => main([ | ||
'--list', | ||
'--directory=test/test-data', | ||
'--language=javascript', | ||
'--language=typescript', | ||
'--test-regex="^xxxxx\.integ-test[12]\.js$"', | ||
])).rejects.toThrowError('Only a single "--language" can be used with "--test-regex". Alternatively provide both "--app" and "--test-regex" to fully customize the configuration.'); | ||
}); |
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 I'm reading everything correctly you can run it for multiple languages if you
just use the defaults, but if you want to customize anything you can only run it
for a single language? Is that right?
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.
Yes that's right. It's because we only have a single pair of --app
and --test-regex
. A possible future extension would be to allow configuring the presets or support passing in a map of app -> test-regex
.
In the meantime, if both is needed, users can always run integ-runner
multiple times, e.g.:
integ-runner --language typescript
integ-runner --language python --app="python3.2"
integ-runner --language go --test-regex=".*\.integ\.go"
@@ -0,0 +1,17 @@ | |||
import aws_cdk as cdk |
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.
Very cool!
6a39e0a
to
5ea37fc
Compare
--language
presets--language
presets for JavaScript, TypeScript, Python and Go
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
It was already possible to run tests in any language by providing
--app
and--test-regex
directly.This change introduces the concept of language presets that can be selected.
By default all supported languages will be detected.
Users can run integration tests for multiple languages at the same time, using the default preset configuration.
To further customize anything, only a single language can be selected. However it's always possible to call the
integ-runner
multiple times:Resolves part of #21169
All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license