-
Notifications
You must be signed in to change notification settings - Fork 7
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 smoke test for the three commands: forge, generator-options and test-generators #163
Comments
I think a smoke test is a great idea 👍 |
Now that we've done some work on this, here are some options:
I recommend option 2, but to move to option 3 or 4 if it proves unreliable with false negatives or false positives. Additionally, the names of the various GitHub Actions should be changed for clarity - "Test Forge" -> "Forge Unit Tests". We can also remove the "Test" Action because it runs the test-generators command on all generators and outputs to a file, which is unlikely to be ever read. This should be covered by the smoke testing anyway. |
(2) seems more powerful to indicate the status of the current state of the branch by having a direct comparison with the main to detect immediate regressions. Only down side I can think of is that, it brings additional complexity to the testing framework. Although, the implementation in #194 does some redundant testing by cloning the main and retesting to mark the comparison point, with the issues related to creating comments/artifacts from action runs, I think this redundancy should be okay. Ideally, we would want to create a certain artifact for this test run such as a file with the number of tests passing in it and read that number as the comparison point for the branch to use directly to avoid redundant work. But as indicated, this can wait until the relevant issues are not present. Regarding (1), isn't this the behaviour we actually expect from the current forge |
I think the original purpose of that test file was to save results and always "pass", but it seems unlikely that anyone will actually look at those results! So, I've deleted it completely here: #196. My suggestion in (1) is to fail the build if any TS tests fail. |
* chore: add smoke test for generator-options command - stdout echoed (#163) * chore: generator-options smoke test added (#163) * chore: wip smoke test-generators (#163) * chore: write smoke test in JS, all three commands pass * chore: pass smoke test work to JS instead of Github Actions * chore: move noisy logs to log file * chore: log available on step failure, clean up comments * chore: revert delete of workflow files * fix: incorrectly removed line * chore: print installed JS and TS generator versions in smoke test * chore: pass test-generators if it has >= passes cpw master
We've merged in smoke tests (#194). I'm sure this will need incremental work, but for now I'll close and let's see how useful (or not!) the smoke tests are... |
Motivation:
Currently it would be easy to break one of the commands. For example, file locations are hardcoded (#158). If they are moved, then one of the commands may fail on a PR without us noticing.
Implementation Details:
Create a GitHub workflow (or add to an existing one) that runs each of the three commands.
./src/index.js forge https://petstore3.swagger.io/api/v3/openapi.json openapi-forge-csharp
returns roughly./src/index.js test-generators -g openapi-forge-typescript
returns roughly./src/index.js generator-options openapi-forge-javascript
(or./src/index.js generator-options ../openapi-forge-javascript
to mix things up with a relative path) returns roughly:The text was updated successfully, but these errors were encountered: