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

Add molecule tests #20

Merged
merged 4 commits into from
Mar 20, 2023
Merged

Add molecule tests #20

merged 4 commits into from
Mar 20, 2023

Conversation

parcimonic
Copy link
Contributor

@parcimonic parcimonic commented Mar 12, 2023

This is the first PR for #19.

I've tested the Molecule settings in both Arch Linux and Ubuntu 22.04 (Vagrant VM).

I didn't want to change too much stuff in the role code to avoid having a larger PR. This is why I'm using "bogus" values for the Grafana auth variables. I plan on submitting changes to the agent template so we can avoid having calls to Grafana cloud without proper authentication values (in the future, after testing framework is in place).

However, I had to fix the systemd service file template, otherwise it would never start correctly.
Edit: this fixes #17.

I chose to use Podman instead of Docker because that's what I'm using to test my own roles. I can revert to Docker if you want me to.

@nleiva
Copy link
Owner

nleiva commented Mar 14, 2023

Thank you!

Should we use geerlingguy/docker-debian11-ansible container image or create a new one so we keep control of the dependencies? I can create one for Debian and another one based on maybe redhat/ubi8 and host them on quay.io.

@parcimonic
Copy link
Contributor Author

I have no preference for the source of the container used by Molecule. If if has systemd, it should work fine.

That said, I do have some hosted at my GitLab:

If this PR gets merged, the next one will actually use a GitHub actions matrix, and the containers will be defined there. If all testable containers come from the same "namespace", the matrix definition gets "cleaner" (see example here for the definition here).

But, again, it is up to you. If you do host your own test containers, please send me the fully qualified image name so I can change it here 🙂

@nleiva
Copy link
Owner

nleiva commented Mar 17, 2023

Ok, I have new container images we could use for testing.

  • quay.io/nleiva/grafana-agent-role-debian
  • quay.io/nleiva/grafana-agent-role-redhat

Their Dockerfiles are in the build folder. You can trigger a new version of the images by modifying the version.json file.

{"version":"v0.1.0"}

This way we have full control and visibility from this repository on the dependencies considered for testing.

The Red Hat image might not work initially, I did my best to port everything on the Debian one there, but I might need to fine tune it.

@parcimonic
Copy link
Contributor Author

parcimonic commented Mar 18, 2023

Thanks for the links.

I've updated the PR to use your Debian image. For Red Hat, I'll add it when I create the build matrix (next PR after this one is merged). Then I can ensure it is working fine :)

I'll rebase this PR and force-push it to add main branch changes.


Edit: rebased and ready for review.

@nleiva
Copy link
Owner

nleiva commented Mar 20, 2023

Thank you @parcimonic

@nleiva nleiva merged commit 3043dd7 into nleiva:main Mar 20, 2023
@parcimonic parcimonic deleted the add-molecule-tests branch March 25, 2023 15:27
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.

Download of agent v0.31.0 broken
2 participants