Skip to content
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

fix: conclusion and outcome are no integers #1136

Merged
merged 3 commits into from
Apr 26, 2022
Merged

fix: conclusion and outcome are no integers #1136

merged 3 commits into from
Apr 26, 2022

Conversation

ChristopherHX
Copy link
Contributor

Closes #1109

If I'm not mistaken there might be still some cases which are invalid for the stepStatus structure.

I'm a bit confused how the expression evaluator is working:
I can't get contains(steps.*.outputs.name, 'value') working.

@ChristopherHX ChristopherHX requested a review from a team as a code owner April 20, 2022 20:42
@github-actions
Copy link
Contributor

github-actions bot commented Apr 20, 2022

MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ CREDENTIALS secretlint yes no 0.96s
✅ EDITORCONFIG editorconfig-checker 3 0 0.49s
✅ GIT git_diff yes no 0.01s

See errors details in artifact MegaLinter reports on CI Job page
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

@mergify
Copy link
Contributor

mergify bot commented Apr 20, 2022

@ChristopherHX this pull request has failed checks 🛠

@mergify mergify bot added the needs-work Extra attention is needed label Apr 20, 2022
@ChristopherHX
Copy link
Contributor Author

Weird weird, should we keep these tests

=== RUN   TestEvaluateStep
=== RUN   TestEvaluateStep/steps.idwithnothing.conclusion
    expression_test.go:181: 
        	Error Trace:	expression_test.go:181
        	Error:      	Not equal: 
        	            	expected: model.stepStatus(0)
        	            	actual  : string("success")
        	Test:       	TestEvaluateStep/steps.idwithnothing.conclusion
        	Messages:   	steps.idwithnothing.conclusion
=== RUN   TestEvaluateStep/steps.idwithnothing.outcome
    expression_test.go:181: 
        	Error Trace:	expression_test.go:181
        	Error:      	Not equal: 
        	            	expected: model.stepStatus(1)
        	            	actual  : string("failure")
        	Test:       	TestEvaluateStep/steps.idwithnothing.outcome
        	Messages:   	steps.idwithnothing.outcome
=== RUN   TestEvaluateStep/steps.idwithnothing.outputs.foowithnothing
=== RUN   TestEvaluateStep/steps.id-with-hyphens.conclusion
    expression_test.go:181: 
        	Error Trace:	expression_test.go:181
        	Error:      	Not equal: 
        	            	expected: model.stepStatus(0)
        	            	actual  : string("success")
        	Test:       	TestEvaluateStep/steps.id-with-hyphens.conclusion
        	Messages:   	steps.id-with-hyphens.conclusion
=== RUN   TestEvaluateStep/steps.id-with-hyphens.outcome
    expression_test.go:181: 
        	Error Trace:	expression_test.go:181
        	Error:      	Not equal: 
        	            	expected: model.stepStatus(1)
        	            	actual  : string("failure")
        	Test:       	TestEvaluateStep/steps.id-with-hyphens.outcome
        	Messages:   	steps.id-with-hyphens.outcome
=== RUN   TestEvaluateStep/steps.id-with-hyphens.outputs.foo-with-hyphens
=== RUN   TestEvaluateStep/steps.id_with_underscores.conclusion
    expression_test.go:181: 
        	Error Trace:	expression_test.go:181
        	Error:      	Not equal: 
        	            	expected: model.stepStatus(0)
        	            	actual  : string("success")
        	Test:       	TestEvaluateStep/steps.id_with_underscores.conclusion
        	Messages:   	steps.id_with_underscores.conclusion
=== RUN   TestEvaluateStep/steps.id_with_underscores.outcome
    expression_test.go:181: 
        	Error Trace:	expression_test.go:181
        	Error:      	Not equal: 
        	            	expected: model.stepStatus(1)
        	            	actual  : string("failure")
        	Test:       	TestEvaluateStep/steps.id_with_underscores.outcome
        	Messages:   	steps.id_with_underscores.outcome
=== RUN   TestEvaluateStep/steps.id_with_underscores.outputs.foo_with_underscores
--- FAIL: TestEvaluateStep (0.00s)
    --- FAIL: TestEvaluateStep/steps.idwithnothing.conclusion (0.00s)
    --- FAIL: TestEvaluateStep/steps.idwithnothing.outcome (0.00s)
    --- PASS: TestEvaluateStep/steps.idwithnothing.outputs.foowithnothing (0.00s)
    --- FAIL: TestEvaluateStep/steps.id-with-hyphens.conclusion (0.00s)
    --- FAIL: TestEvaluateStep/steps.id-with-hyphens.outcome (0.00s)
    --- PASS: TestEvaluateStep/steps.id-with-hyphens.outputs.foo-with-hyphens (0.00s)
    --- FAIL: TestEvaluateStep/steps.id_with_underscores.conclusion (0.00s)
    --- FAIL: TestEvaluateStep/steps.id_with_underscores.outcome (0.00s)
    --- PASS: TestEvaluateStep/steps.id_with_underscores.outputs.foo_with_underscores (0.00s)

Probably something to discuss....

@codecov
Copy link

codecov bot commented Apr 20, 2022

Codecov Report

Merging #1136 (909f2fc) into master (4f8da0a) will increase coverage by 2.55%.
The diff coverage is 79.12%.

@@            Coverage Diff             @@
##           master    #1136      +/-   ##
==========================================
+ Coverage   57.50%   60.06%   +2.55%     
==========================================
  Files          32       39       +7     
  Lines        4594     4946     +352     
==========================================
+ Hits         2642     2971     +329     
- Misses       1729     1731       +2     
- Partials      223      244      +21     
Impacted Files Coverage Δ
pkg/model/action.go 0.00% <ø> (ø)
pkg/model/planner.go 50.73% <ø> (+0.32%) ⬆️
pkg/model/workflow.go 50.91% <ø> (ø)
pkg/container/docker_run.go 5.11% <2.50%> (-0.43%) ⬇️
pkg/common/git.go 49.31% <28.57%> (-0.52%) ⬇️
pkg/container/file_collector.go 44.85% <44.85%> (ø)
pkg/runner/logger.go 66.00% <67.56%> (+0.56%) ⬆️
pkg/runner/runner.go 73.72% <73.68%> (-2.75%) ⬇️
pkg/exprparser/interpreter.go 75.29% <75.00%> (+1.89%) ⬆️
pkg/runner/expression.go 89.31% <78.26%> (-1.51%) ⬇️
... and 19 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@mergify mergify bot removed the needs-work Extra attention is needed label Apr 20, 2022
@mergify mergify bot merged commit 77ddc89 into master Apr 26, 2022
@mergify mergify bot deleted the exprevalfixes branch April 26, 2022 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

conditional steps incorrectly evaluates conclusion
2 participants