-
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
add assertions tests #1411
add assertions tests #1411
Conversation
SessionNavigationBean bean = request.getNavigationBean(selections); | ||
return request.requestWithBean(bean); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can simplify this a bit:
SessionNavigationBean bean = request.getNavigationBean(selections); | |
return request.requestWithBean(bean); | |
return request.request(selections); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simplified here cd051b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Robert, the PR looks good. Wondering if it's possible to comment on the PR the changes in .ccz
file for the sake of visibility.
Also we should add tests for a few different type of edge cases we discovered during testing this -
- Assertions that use external instances
instance(x)
- Assertions on root menu with instance connectors defined in
menu
It would also be great to have both positive and negative test cases around assertions. For eg we can write tests testing count(instance('commcaresession')/session/user/data/project_role) > 0
for 2 different users (aka with 2 different restores) one with project_role
and other without and check assertions accordingly.
CommandListResponseBean.class); | ||
assertNotNull(response0); | ||
// Check failing assertion | ||
assertThrows(Exception.class, () -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also verify that exception has the right message as per assertions here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verified here 19a982c
in the suite file I added assertions and instance references to the groups fixture already being used. menu 0: menu 1: In addition I also added a new menu |
Several tests that are failing here are passing locally. They all look related to the suite file changes in basic test app. |
They seem to fail locally as well for me. You probably wanna cross-check changes in |
It turns out that it's the submodule ref that is causing the failures. When I switch to the formplayer branch locally, I get the same failures. |
update for tests
Codecov Report
@@ Coverage Diff @@
## master #1411 +/- ##
============================================
- Coverage 69.66% 69.61% -0.06%
+ Complexity 1918 1916 -2
============================================
Files 247 247
Lines 7529 7529
Branches 674 674
============================================
- Hits 5245 5241 -4
- Misses 2020 2026 +6
+ Partials 264 262 -2 see 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
<Sync xmlns="http://commcarehq.org/sync"> | ||
<restore_id>9f7c4e0a3a8ca4e2ecf54444fb7e70cf</restore_id> | ||
</Sync> | ||
<Registration xmlns="http://openrosa.org/user/registration"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we trim the file to only contain what's necessary for the test. I believe you should be able to remove most of the info in this file for the assertion test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. Yes, I'll trim it down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore updated here 0663863
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Technical Summary
relates to dimagi/commcare-core#1267
Safety Assurance
just tests
Safety story
Automated test coverage
is only tests
QA Plan
relates to this QA ticket: https://dimagi-dev.atlassian.net/browse/QA-5258
Special deploy instructions
Rollback instructions
Review