tests(pam/testutils): Integration tests for the PAM CLI#109
tests(pam/testutils): Integration tests for the PAM CLI#109denisonbarbosa merged 8 commits intomainfrom
Conversation
|
I could extract the |
5385449 to
6619df5
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #109 +/- ##
==========================================
- Coverage 88.62% 83.21% -5.42%
==========================================
Files 34 56 +22
Lines 2532 4473 +1941
==========================================
+ Hits 2244 3722 +1478
- Misses 221 583 +362
- Partials 67 168 +101 ☔ View full report in Codecov by Sentry. |
GabrielNagy
left a comment
There was a problem hiding this comment.
Great work! Nice to see the vhs thing working in the end. I left my comments inline
pam/integration-tests/testdata/tapes/mandatory_password_reset.tape
Outdated
Show resolved
Hide resolved
6619df5 to
0b5edd5
Compare
|
I didn't go through the vhs docs yet, but maybe it would be convenient adding a |
I don't really like adding assets that are not related to the tests themselves inside |
Well I'm not sure where is the right place, in other projects I contribute or mantain we normally keep a readme in the places the artifacts are so that it's easy for everyone to find out how those are generated. However, I'm fine with other options too, I just think it's important to have the process documented so that when others will have to regenerate them can figure it out easily. |
Note: I didn’t look at any comments than this exchange. I think this is the perfect place for the contributing guide on "how to refresh blablabla" (same for golden files btw) |
35baf76 to
9116345
Compare
GabrielNagy
left a comment
There was a problem hiding this comment.
Great job on this! Can we ensure debian packaging works properly with these changes as well?
@denisonbarbosa I was quickly grepping on the diff and I didn't notice anything related to this, is the process documented now? |
3v1n0
left a comment
There was a problem hiding this comment.
I think we're there, I've spotted few tiny things.
0de75ce to
23d4351
Compare
didrocks
left a comment
There was a problem hiding this comment.
I think I was able to review every changes since the rebase. I have only 2 minor comments and then, we’ll be good from my side of things!
didrocks
left a comment
There was a problem hiding this comment.
All good from my side! Of course, needs to solve the conflict while rebasing, but otherwise, good! :)
GabrielNagy
left a comment
There was a problem hiding this comment.
Looks good to me, great work here!
didrocks
left a comment
There was a problem hiding this comment.
I think Gabriel is right, we need to skip them during autopkgtests too.
didrocks
left a comment
There was a problem hiding this comment.
Great work! Once fixing the conflicts and rebase, you can merge :)
We wrote some helper functions for the NSS integration tests, but they will be helpful for the PAM integration tests as well. So, in order to avoid copying code and then having to maintain both helpers, it's better to move the helpers to testutils.
cbb5e59 to
5fc6623
Compare
5fc6623 to
7575eee
Compare
We need to install vhs and ttyd to run the integration tests in the CI and also export an environment variable to build the PAM module without any warnings
The CLI tests rely on external dependencies to run and they are not available in the archive, so we must skip them on environments that do not support external sources.
Since we rely on the mock to test some behaviors in the CLI tests, we have to be able to build the binary with the mock. This now is doable by using the "integrationtests" build tag.
7575eee to
10d92c3
Compare
This adds integration tests for the PAM module and moves some code around to avoid copying and maintain consistency between our integration tests.
The golden files are
ASCIIrepresentations of terminal screenshots, so don't get scared by the number of lines changed (I promise it will be okay).UDENG-1456