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

Github integration tests #179

Closed
wants to merge 8 commits into from
Closed

Github integration tests #179

wants to merge 8 commits into from

Conversation

picnoir
Copy link
Member

@picnoir picnoir commented May 29, 2018

Hi,

As previously discussed in the IRC room, I have been working on a GitHub E2E test.

I've got a first prototype, this is not ready to merge yet. I mostly open this PR to ask some questions.

Here's what I still need to do before considering this PR as complete.

  • Find a way to provision/run the testing environment. Something like nixpkgs/lib/testing.nix ?
  • Find a way to run those tests is a CI.
  • Add missing GH events (PR open, PR comment, PR having an incorrect title, ...)
  • Get rid of those nasty tabs.

Provisionning/Run the testing environment

I am still a rookie regarding nix and never used it to provision a testing environment. I saw the nix-test chapter in the nixos manual and thought it would be a good candidate. However, I was unable to find an example of a nix-test use outside of the nixpkgs repository.

We basically just need Ofborg's rust application together with rabbitmq to conduct those tests.

So, dear nix power users, here are the actual questions :) How are you usually writing your E2E tests while using nix? What do you think about /lib/testing.nix? Is there a similar yet better way to generate those tests?

I am open to any suggestions!

@picnoir
Copy link
Member Author

picnoir commented May 30, 2018

Good news: I managed to shove this test in a VM using nix-test.

nix-build default.nix -A ofborg.integrationTests to run them.

Just need to find a way to run this in travis or hydra and we should be good.

[edit] looks like vim is getting crazy and is inserting tabs a bit everywhere, I'll fix this before merging. Sorry about that...

@picnoir
Copy link
Member Author

picnoir commented May 31, 2018

Small CI update

So, I've been trying to run this on both Travis and CircleCI.

Travis

The VM successfully boots up, but for some reason, the rabbitmq service is not able to start. Can't say if this is related to this or if it's a weird behavior triggered by the odd setup (qemu machine in travis). Full log here.

We were so close, it's kind of frustrating...

Circle CI

The VM can't even boot up, it seems unable to mount the vda disk. I guess it's a dead end, full log here.

Hydra?

I guess the only remaining solution is Hydra. Sadly, hydra can't build PR so far, which kind of negate this kind of e2e test purpose.

Ofborg Itself

@LnL7 mentionned this on IRC. This is probably our best shot actually. However, we'll need a nixpkgs checkout along with this repo to build the tests.

Any suggestions?

@picnoir picnoir changed the title [WIP] Github integration tests Github integration tests May 31, 2018
@aycanirican
Copy link
Member

aycanirican commented May 31, 2018

@NinjaTrappeur Hydra can build PRs, we're building our PRs with hydra for around two years. See relevant module https://github.com/NixOS/hydra/blob/master/src/lib/Hydra/Plugin/GithubPulls.pm. You can also find an example here written for demonstration purposes https://github.com/aycanirican/declarative-hydra-test.

@@ -65,4 +65,6 @@ in {
cd ..
mv ofborg $out
'';

ofborg.integrationTests = pkgs.callPackage ./e2e-tests/default.nix {};
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be moved to release.nix, that's what hydra uses.

@@ -0,0 +1,33 @@
import <nixpkgs/nixos/tests/make-test.nix> ({ pkgs, ...}: rec {
Copy link
Member

Choose a reason for hiding this comment

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

This uses nixpkgs from NIX_PATH instead of the version used by the build itself and won't work on hydra, depending on the jobset configuration.


# Kind of a dirty hack... We call evaluation-filter to create
# the exchange/queue routes.
evaluation-filter "${configPath}" &
Copy link
Member

Choose a reason for hiding this comment

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

This entire script doesn't do much other than calling ofborg binaries, using a rust binary for the test itself would enable sharing code for setup like this, etc.

@picnoir
Copy link
Member Author

picnoir commented Apr 22, 2021

Just stumbled upon that one. Reading this 4 years later, this PR sounds out of place to me. Closing it.

@picnoir picnoir closed this Apr 22, 2021
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.

None yet

3 participants