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

Add more expression operator tests for alert profiles and fix cleaning in ExpressionForm #2752

Conversation

johannaengland
Copy link
Contributor

Add more tests to make sure that all kind of values can be posted for all different operators.

That also revealed that only in case of the equal operator with values being selected from a list that value is then sent as a list. In case of sysname the value is still a string and therefore should not be cleaned the same way.

See the second commit for the specific test for that.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (74a9c23) 55.61% compared to head (f325211) 55.61%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2752   +/-   ##
=======================================
  Coverage   55.61%   55.61%           
=======================================
  Files         567      567           
  Lines       41247    41247           
=======================================
  Hits        22941    22941           
  Misses      18306    18306           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Nov 20, 2023

Test results

     12 files       12 suites   11m 55s ⏱️
3 280 tests 3 280 ✔️ 0 💤 0
9 315 runs  9 315 ✔️ 0 💤 0

Results for commit f325211.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@hmpf hmpf left a comment

Choose a reason for hiding this comment

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

Suggestion: split the ip-address and sysname tests into separate classes (and the tests for the remainder stays where they are. This highlights that ip-address and sysname are special snowflakes.

@johannaengland johannaengland requested a review from hmpf November 20, 2023 11:32
Copy link
Contributor

@hmpf hmpf left a comment

Choose a reason for hiding this comment

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

For future polish:

Rename TestsExpressions to TestAddExpressions and remove alertprofiles_add_expression_with_ from every method name since it is redundant.

@johannaengland johannaengland force-pushed the tests/alertprofiles/add-expression-tests branch from 94b3460 to f325211 Compare November 21, 2023 07:44
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@johannaengland johannaengland merged commit 9add534 into Uninett:master Nov 21, 2023
@johannaengland johannaengland deleted the tests/alertprofiles/add-expression-tests branch November 21, 2023 07:53
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.

2 participants