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(HACBS-1535): Improve test coverage #97

Merged
merged 4 commits into from
Feb 20, 2023

Conversation

MartinBasti
Copy link
Collaborator

@MartinBasti MartinBasti commented Feb 9, 2023

See the commits

Test a case when a test pipelinerun is without component and aplication
names is taken from pipeline run itself

Signed-off-by: Martin Basti <mbasti@redhat.com>
@MartinBasti MartinBasti changed the title fix(HACBS-1535): pipeline controller test coverage fix(HACBS-1535): Improve test coverage Feb 9, 2023
@codecov
Copy link

codecov bot commented Feb 9, 2023

Codecov Report

Base: 68.23% // Head: 70.71% // Increases project coverage by +2.48% 🎉

Coverage data is based on head (1f031ba) compared to base (3728919).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #97      +/-   ##
==========================================
+ Coverage   68.23%   70.71%   +2.48%     
==========================================
  Files          24       25       +1     
  Lines        2147     2223      +76     
==========================================
+ Hits         1465     1572     +107     
+ Misses        539      499      -40     
- Partials      143      152       +9     
Impacted Files Coverage Δ
controllers/pipeline/pipeline_controller.go 65.78% <100.00%> (+5.23%) ⬆️
gitops/snapshot.go 78.76% <0.00%> (-1.94%) ⬇️
controllers/scenario/scenario_controller.go 78.26% <0.00%> (ø)
metrics/integration.go 85.71% <0.00%> (ø)
helpers/integration.go 67.15% <0.00%> (+1.45%) ⬆️
controllers/pipeline/pipeline_adapter.go 58.27% <0.00%> (+5.61%) ⬆️
controllers/snapshot/snapshot_adapter.go 56.57% <0.00%> (+7.90%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MartinBasti
Copy link
Collaborator Author

I've no idea how codecov is reporting coverage, in my local coverage it's higher.
github.com/redhat-appstudio/integration-service/controllers/pipeline/pipeline_controller.go (72.9%)

And files I haven't touched are suddenly changing coverage

When applicaton is nil, it should fail gracefully instead of panic.

Signed-off-by: Martin Basti <mbasti@redhat.com>
Body of EnsureSnapshotPassedAllTests depends mainly on test pipeline.
Without test pipelinerun it just skips majority of code. Adding label
test to pipeline run, to increase coverage.

Signed-off-by: Martin Basti <mbasti@redhat.com>
@MartinBasti MartinBasti force-pushed the update-test-coverage-2 branch 2 times, most recently from a1a38f1 to 1288c6c Compare February 15, 2023 16:18
Add test coverage for
updateExistingSnapshotEnvironmentBindingWithSnapshot

Signed-off-by: Martin Basti <mbasti@redhat.com>
Copy link
Contributor

@jsztuka jsztuka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@MartinBasti MartinBasti merged commit fa22f5b into konflux-ci:main Feb 20, 2023
@MartinBasti MartinBasti deleted the update-test-coverage-2 branch February 20, 2023 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants