-
Notifications
You must be signed in to change notification settings - Fork 728
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
Create E2E tests for Bicep CLI commands #938
Conversation
"version": "1.0.0", | ||
"private": true, | ||
"dependencies": {}, | ||
"devDependencies": { |
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 think you'll need to add this path to https://github.com/Azure/bicep/blob/main/.github/dependabot.yml
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.
Good to know! I added it to the dependabot file.
const exampleBicepFile = path.join(exampleDirectory, "main.bicep"); | ||
const exampleJsonFile = path.join(exampleDirectory, "main.json"); | ||
|
||
describe("bicep build", () => { |
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.
describe [](start = 0, length = 8)
We should also do a failed build test to make sure we're logging warnings and errors to stderr.
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.
Good pt. Added a test.
Codecov Report
@@ Coverage Diff @@
## main #938 +/- ##
=======================================
Coverage 94.55% 94.55%
=======================================
Files 302 302
Lines 13682 13682
Branches 12 12
=======================================
Hits 12937 12937
Misses 745 745
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -64,6 +64,12 @@ jobs: | |||
- name: Publish Bicep | |||
run: dotnet publish --configuration ${{ matrix.configuration }} --self-contained true -p:PublishTrimmed=true -p:PublishSingleFile=true -r ${{ matrix.rid }} ./src/Bicep.Cli/Bicep.Cli.csproj | |||
|
|||
- name: Run Bicep E2E Tests |
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.
name [](start = 8, length = 4)
Is it possible to also upload coverage data from this npm run as well?
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 possible and easy to collect and upload coverage data because we are using jest, but does it make sense to do so? We are testing a binary file and the coverage will be 0 for sure (unless we want to cheat by including the test files themselves :p).
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're kind of all over the place in that regard. (c# info includes test code as well). I'm fine skipping that 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.
In the future we could split and tag test code coverage separately. It sometimes can be useful to see coverage highlights there, but it's pretty rare.
Closes #381.