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

gh-actions: add tests for packages built with goreleaser #34

Merged
merged 3 commits into from
Feb 29, 2024

Conversation

olifre
Copy link
Contributor

@olifre olifre commented Nov 10, 2023

This tests building the packages, and also testing the deb and rpm packages on various versions of Debian and RockyLinux.

It covers:

  • goreleaser building everything (releasing suppressed)
  • installation of deb and rpm packages on various distros
  • spinning up distro containers including systemd
  • testing the systemd unit with a simple config file
  • basic test of the installed createtoken binary
  • basic test of the shoveler-status binary

@djw8605 I realized current tests did not cover the systemd service nor packaging yet, so I added this as a first step before I will later on attack adding support for running as non-root user. So the tests are essentially the preparation to ensure I don't break anything 😉 .

Checking the goreleaser docs, it seems user creation must be done "classically", i.e. via scripts which are embedded in the packages via goreleaser, following distro best practices (sadly, gorelease can not do that by itself).
Hence, having tests covering the packages and the systemd unit in place first seemed important.

@djw8605
Copy link
Member

djw8605 commented Nov 10, 2023

Thanks for the pull request. I think we are quickly approaching enough complexity to warrant creating an RPM the old fashioned way, rather than using goreleaser.

I’ll review this shortly

@olifre
Copy link
Contributor Author

olifre commented Nov 10, 2023

I’ll review this shortly

Thanks!
I already fixed a few small nits in two follow-up commits, found during development of the packaging code for local user creation (I'm almost there, will PR this sometime later, likely during the weekend).

@olifre
Copy link
Contributor Author

olifre commented Nov 10, 2023

I'm almost there, will PR this sometime later, likely during the weekend

That was faster than expected, I'm already done 😉. But I'll hold off on a PR for "run as user" (see https://github.com/olifre/xrootd-monitoring-shoveler/tree/run-as-user ) until both #34 and #23 are in, since it (partially) relies on these two changes.

This tests building the packages, and also testing the deb and rpm packages
on various versions of Debian and RockyLinux.

It covers:
* goreleaser building everything (releasing suppressed)
* installation of deb and rpm packages on various distros
* spinning up distro containers including systemd
* testing the systemd unit with a simple config file
* basic test of the installed createtoken binary
* basic test of the shoveler-status binary
This ensures we get coverage for all distros,
important e.g. if tests only fail for one distro flavour.
@olifre olifre force-pushed the add-package-test-action branch from 55b5aad to f12545b Compare January 18, 2024 22:17
@olifre
Copy link
Contributor Author

olifre commented Jan 18, 2024

@djw8605 I have force-pushed here, rebasing onto current main, bumping the Go version used in these added tests to match the one used for the existing tests by now, and also incorporating the new default queue path in these tests.
So this is now up-to-date again.

@djw8605 djw8605 merged commit f4ccffc into opensciencegrid:main Feb 29, 2024
@djw8605
Copy link
Member

djw8605 commented Feb 29, 2024

Hi @olifre, after merging, the tests fail. Is it because we moved the queue directory? The error gets truncated off from the systemctl status output (should increase that).

Tracking in #56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants