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

1233-Rework tests #306

Merged
merged 31 commits into from
May 4, 2023
Merged

1233-Rework tests #306

merged 31 commits into from
May 4, 2023

Commits on May 3, 2023

  1. Refactor tests

    - Migrate to a non-global VM object
    - Refactor qr registration and decentralized tests
      to not need a separate CI pipeline to run in parallel
    - Add valid header on config generated by `create-config`
    - Run decentralized tests with 2 VMs in parallel
    - Enable available-releases test
    - Bump github action and golang version used in tests
    - Fix qr code registration test
    - Import go-nodepair from kairos-io
    - Bump go-nodepair to depend on the same version of edgevpn
      and fix compilation issues
    - Rename jobs to match test files and merge available_releases with test job
    - Run all jobs on ubuntu-latest with qemu
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    fe55649 View commit details
    Browse the repository at this point in the history
  2. Remove mac commands from ubuntu worker

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    23b7cbc View commit details
    Browse the repository at this point in the history
  3. Setup qemu in Github Action worker

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    f71f9b9 View commit details
    Browse the repository at this point in the history
  4. Add debug output

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    60322b8 View commit details
    Browse the repository at this point in the history
  5. Bump peg to show better error

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    e3e82f5 View commit details
    Browse the repository at this point in the history
  6. Bump go-nodepair to fix kairos-io/kairos#1251

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    79dbbb2 View commit details
    Browse the repository at this point in the history
  7. Show free disk space

    (suspecting we don't have enough space to create a 40g disk for qemu)
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    d345f13 View commit details
    Browse the repository at this point in the history
  8. Bump peg in order to control the size of the vm disk to be created

    because we don't have enough space for the previous hardcoded 30g for qemu
    
    Also install missing qemu-img package
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    113406a View commit details
    Browse the repository at this point in the history
  9. Install qemu the same way we do in kairos-io/kairos

    because the GA action doesn't put the binaries in a place where I can
    find them.
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    3952b7a View commit details
    Browse the repository at this point in the history
  10. Decrease memory per VM to be able to fit 2 of them in the same worker

    so that decentralized tests can run successfully
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    2a063f8 View commit details
    Browse the repository at this point in the history
  11. Decrease required resources more and remove debug text

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    89cc0d0 View commit details
    Browse the repository at this point in the history
  12. Remove dependencies from tests

    to allow them to run in parallel and see if the rest of them (other than
    the decentralized one) pass.
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    1f30f94 View commit details
    Browse the repository at this point in the history
  13. Run tests on self-hosted workers with KVM

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    01d16f5 View commit details
    Browse the repository at this point in the history
  14. Use fork of action

    until this is merged: docker-practice/actions-setup-docker#31
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    810881d View commit details
    Browse the repository at this point in the history
  15. Don't setup docker

    On our self-hosted runners, it's already there
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    53ccefb View commit details
    Browse the repository at this point in the history
  16. Run build job both in self-hosted and ubuntu-latest runners

    to save time
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    f8f327b View commit details
    Browse the repository at this point in the history
  17. Run matrix job on any runner

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    92af7bb View commit details
    Browse the repository at this point in the history
  18. Always cancel PR older CI jobs

    because the head_ref may change if we rebase the PR, which will result
    in the old jobs to keep running. By using the pull_request.number we
    make sure we always stop older jobs for the same PR (even on rebase).
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    c3e42c4 View commit details
    Browse the repository at this point in the history
  19. Change step condition to detect self-hosted runners

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    58fc2a3 View commit details
    Browse the repository at this point in the history
  20. Fix step conditional

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    6f23ae6 View commit details
    Browse the repository at this point in the history
  21. Revert hacks, Github is doesn't support running in any worker

    (unless maybe if we label our self-hosted runners as "ubuntu-latest" or
    something)
    
    "These labels operate cumulatively, so a self-hosted runner must have all four labels to be eligible to process the job."
    
    https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/using-self-hosted-runners-in-a-workflow
    
    It's not an "OR" it's and "AND"
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    9a053ab View commit details
    Browse the repository at this point in the history
  22. Remove unecessary actions (not working) and run apt update

    before we install packages
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    1b60648 View commit details
    Browse the repository at this point in the history
  23. Fix pipeline and detect flavor using /etc/os-release

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    87d57ba View commit details
    Browse the repository at this point in the history
  24. Fix syntax errors and remove unnecessary "And"

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    819e700 View commit details
    Browse the repository at this point in the history
  25. Double the waiting time until vm reboots

    to see if this fixes the timeouts in CI
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    8b04743 View commit details
    Browse the repository at this point in the history
  26. Add debug output

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    a020aa3 View commit details
    Browse the repository at this point in the history
  27. Increase more Reboot() timeouts

    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    82449cc View commit details
    Browse the repository at this point in the history
  28. Increase decentralized_test resources

    to avoid timeouts. It passes locally with this amount of resources so...
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    0d4d7a2 View commit details
    Browse the repository at this point in the history
  29. Increase memory and run ginkgo recover before go routine 'Done()'

    because otherwise, the test continues and prints the next "By" statement
    between running "Done" and running "Recover" making the output
    confusing.
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    f762974 View commit details
    Browse the repository at this point in the history
  30. Ditch go routines and do things serial

    because making ginkgo stop when our goroutines fails is unexpectedly
    difficult
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    9531b13 View commit details
    Browse the repository at this point in the history
  31. Don't break the config file with go mod tidy output

    By inspecting the generated config file for the decentralized test in
    the CI runner, I found that it had lines like:
    
    ```
    go: downloading github.com/kairos-io/go-nodepair v0.0.0-20230424150716-d8f0757542c3
    go: downloading github.com/kairos-io/kairos/v2 v2.0.3
    go: downloading github.com/mudler/edgevpn v0.23.1
    go: downloading github.com/mudler/yip v1.0.0
    ...
    ```
    
    This comes from the fact that the first time we run the `main.go` file,
    the dependencies need to be downloaded. By running `go mod tidy` first,
    the `go run` command won't print those.
    
    Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
    jimmykarily committed May 3, 2023
    Configuration menu
    Copy the full SHA
    6d86ed1 View commit details
    Browse the repository at this point in the history