Added Integration Tests to iiab-install-smoke-test.yml - #329
Conversation
|
@Akatama does this presumably add less than a minute on top of the ~10 minute install? Related: |
|
Yes, it adds like 30 seconds total |
Great! @thotmx what do you think of this PR? |
|
@Akatama can you remind us all how these "2 tests" are being invoked exactly? And what exactly's being tested? (Can you explain quick how this is working without obviously invoking .github/workflows/integration-test.yml or a curl command towards testing login etc?!)
( Above example output pasted in from the bottom of GitHub Action results https://github.com/iiab/calibre-web/actions/runs/16487275854/job/46614490105?pr=329 ) |
Pytest. You can see the pytest command in the screenshot you sent. This is the full command: Here are the commands that we are passing to pytest: -s: means to print the output to the command line
@thotmx Is the one who wrote these tests, but I will describe them to you I recommend looking at the documentation for further details, including how the tests are organized. |
|
The PR looks good to me. Can you just confirm the comment related with the virtual environment? |
The virtual environment is created by the IIAB install script (which further calls the IIAB Ansible config). It is done a bit weirdly, but Adam seemed resistant to change it. In short, the venv is created and then calibre-web is cloned inside of it. According to Adam, it has been this way for some time. Anyway, if I sourced venv/bin/activate and it didn't exist, the workflow would error out. (In this case, since we are already in the venv, it is just /bin/activate) |
|
Got it. But I think the problem with the cache permission could be related. I think to create a new venv for testing is not bad, considering it would isolate the few testing suite dependencies from any other dependency. And it would run in the 'scope' of the user running the Github Workflow. My two cents. But if you says it's ok as it is. I approve it. |
|
@holta @thotmx I tried a couple of things. First, I tried creating a new venv in /usr/local/calibre-web-py3. This worked fine if you used sudo when creating the venv, but we still had the pytest caching warning. Next, I tried creating the venv in $GITHUB_WORKSPACE, sourcing that venv, installing the integration-tests-requirements.txt file, then running pytest. Again, it worked fine, but the pytest caching warning still appeared. So what we would probably need to do is this:
It is definitely doable, but I think it complicates the workflow compared to adding one option to pytest, which is explained in both this PR and in the workflow itself. Let me know what you think. |
|
Should this PR be merged in the coming ~24 hours? Sounds very reasonable? (@Akatama maybe also hint at where we might go next, building out CI / specific test cases, if you have a moment?) |
thotmx
left a comment
There was a problem hiding this comment.
Agree, keeping simple at this stage is better considering the change is only an extra parameter.
Sure!
However, we sort of expect every PR merge to be its own release. As such, we may just decide to eat the time cost of running a lot of tests for each PR. If we really want to, we still could split it up into smoke tests workflow and all tests workflow and just have them all run before the PR is accepted. Let me know your thoughts @holta @thotmx. The benefit of this splitting is if the smoke test workflow fails we will know something is really wrong and we will know it relatively quickly. The disadvantage of such a strategy is a lot of work is done twice (install IIAB, Firefox and test dependencies). To be clear, the current test run takes around 30 seconds, but around 26 of those seconds are installing Firefox and installing the test dependencies. So the tests take like ~4 seconds to run total. |
|
Thanks @Akatama for outlining:
🍃 🍃 🍃
☯️ |
|
Thanks @thotmx for reviewing! 💫 |

Currently it is only running with Firefox. Since we're just trying to confirm that the IIAB install was successful, I figured running both would just make the workflow even more complicated. However, if we decide that Google Chrome is better to run the tests on, then we can do that instead.
There was some kind of permissions issue - Pytest likes to cache some stuff during the test runs. To be clear, both tests still passed, but I didn't like the warning gumming up the output. Especially if we looked at this a year from now, we might forget that it was just pytest complaining about something. The fix I have put in now is to call pytest with
-p no:cacheprovider. The caching wouldn't matter anyway since we are running this as a GitHub Action workflow.Whatever permissions issue, it appears to be unique to the GitHub Actions runner VM, as I did not run into that warning when I made the test work with sudo back in PR #311
@holta