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

tests: Add functional tests using NixOS in Podman (Docker) #1326

Closed
wants to merge 15 commits into from

Conversation

adisbladis
Copy link
Member

@adisbladis adisbladis commented Apr 27, 2020

We want to extend "real world" testing by a lot in NixOps and containers is a way we can do so within the confines of free Github Actions runners.

@adisbladis adisbladis force-pushed the functional-container-tests branch 2 times, most recently from 3bbfdd6 to 0843a26 Compare April 28, 2020 09:44
Copy link
Member

@grahamc grahamc left a comment

Choose a reason for hiding this comment

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

I was collecting more feedback than this, but I think the comment about docker is sufficient to Request Changes now 😂 .

@@ -0,0 +1,14 @@
import os
Copy link
Member

Choose a reason for hiding this comment

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

We should find the tests that apply to nixops core and keep them, and delete the rest.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's do that in a follow-up?

@@ -59,3 +59,12 @@ jobs:
uses: cachix/install-nix-action@v8
Copy link
Member

Choose a reason for hiding this comment

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

  • Needs documentation in the readme on how to write / run tests
  • I couldn't run the tests without installing podman / docker, so that should be written down too
  • it'd be cool to switch to pytest, which supports auto-discovering test case files automatically:
@pytest.mark.parametrize("path", pathlib.Path().glob("**/*.nix"))
def test_nix_file(path): ...

tests/functional/test_deploy.py Show resolved Hide resolved
@adisbladis adisbladis force-pushed the functional-container-tests branch 2 times, most recently from 36be987 to bc3ae75 Compare April 30, 2020 17:05
@adisbladis adisbladis changed the title tests: Add functional tests using NixOS in Docker tests: Add functional tests using NixOS in Podman (Docker) Apr 30, 2020
@adisbladis adisbladis force-pushed the functional-container-tests branch 2 times, most recently from 5d4d0e5 to b5e940f Compare April 30, 2020 17:44
Running a full systemd including gettys inside a privileged container
has nasty side effects such as the container getty starting to write
to the same tty as the system getty.

Always run Podman since it can run rootless and doesn't suffer from
these drawbacks.
Copy link
Member

@grahamc grahamc left a comment

Choose a reason for hiding this comment

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

I wonder if we should:

  1. use Popen and a context manager
  2. with some asyncio things to capture stdout and stderr and forward to the test log
  3. on exit of the manager, send the podman process the RTMIN+14 signal, (from man systemd):
       SIGRTMIN+14
           Immediately powers off the machine.

Right now after my testing I have lots of extra podman log processes and podman containers running.

tests/functional/test_deploy.py Outdated Show resolved Hide resolved
tests/functional/test_deploy.py Outdated Show resolved Hide resolved
Co-authored-by: Graham Christensen <graham@grahamc.com>
@grahamc grahamc added this to In progress in kanban May 5, 2020
@grahamc grahamc self-assigned this May 5, 2020
@adisbladis adisbladis mentioned this pull request Nov 24, 2020
16 tasks
@adisbladis
Copy link
Member Author

This is too complex.. I think we'll just bite the bullet and accept that Github Actions is going to be slow and use the NixOS VM test infra regardless.

@adisbladis adisbladis closed this Feb 3, 2021
kanban automation moved this from In progress to Done Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
kanban
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants