Feature: Add test step to CI workflow.#3459
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: twoGiants The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/cc @matejvasek @lkingland @gauron99 Next one is ready for review! 😸 👍 |
The generated GitHub workflow now includes a "Run tests" step that runs before deployment. The test command is selected based on the function runtime: `go test ./...` for Go, `npm test` for Node.js, and `python -m pytest` for Python. Unsupported runtimes skip the step with a warning. The step can be disabled via --test-step=false. Issue 3256 Signed-off-by: Stanislav Jakuschevskij <[email protected]>
700184d to
b04f22b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3459 +/- ##
==========================================
- Coverage 54.71% 54.70% -0.01%
==========================================
Files 181 181
Lines 20394 20425 +31
==========================================
+ Hits 11158 11174 +16
- Misses 8059 8074 +15
Partials 1177 1177
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gauron99
left a comment
There was a problem hiding this comment.
nice! just few questions from me
| }) | ||
| } | ||
|
|
||
| func TestNewConfigCICmd_TestStepPerRuntime(t *testing.T) { |
There was a problem hiding this comment.
should we also add go runtime here for completeness?
| } | ||
|
|
||
| func NewGitHubWorkflow(conf CIConfig) *githubWorkflow { | ||
| func NewGitHubWorkflow(conf CIConfig, runtime string, messageWriter io.Writer) *githubWorkflow { |
There was a problem hiding this comment.
would it make sense here to have runtime as part of the CIConfig as well? not sure about the messageWriter
| testStep.withRun("npm test") | ||
| case "python": | ||
| testStep.withRun("python -m pytest") | ||
| default: |
There was a problem hiding this comment.
Please add quarkus -- ./mvnw test.
| case "go": | ||
| testStep.withRun("go test ./...") | ||
| case "node": | ||
| testStep.withRun("npm test") |
There was a problem hiding this comment.
Don't we need to call npm install first?
| case "node": | ||
| testStep.withRun("npm test") | ||
| case "python": | ||
| testStep.withRun("python -m pytest") |
There was a problem hiding this comment.
Don't we need to call pip instal… first?
Changes
--test-stepflag tofunc config ci, enabled by default, disable with--test-step=falsego test ./...for Go,npm testfor Node.js,python -m pytestfor Python/kind enhancement
Relates to #3256
Release Note
Docs