Skip to content

Commit

Permalink
move v3-e2e-testing fetcher out of flake (#41)
Browse files Browse the repository at this point in the history
Removes the `v3-e2e-testing` input from `flake.nix`, and moves it to a fetcher in the arion configuration that runs the e2e service. The e2e repo is private - if we keep it in the flake the entire nix setup will be broken for anyone who isn't set up to access the e2e repo with ssh authentication. Moving the fetcher to that specific arion config file prevents an authentication error unless you're specifically running e2e tests.

The advantage of having inputs in `flake.nix` is that we can update versions with commands like `nix flake update`, and nix handles locking versions automatically. OTOH with `builtins.fetchGit` we have to edit the file to set the git revision that we want.
  • Loading branch information
hallettj committed Apr 16, 2024
1 parent 58b90ca commit 8b61723
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 30 deletions.
11 changes: 10 additions & 1 deletion arion-compose/service-e2e-testing.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@
}:

let
v3-e2e-testing-source = builtins.fetchGit {
url = "git+ssh://git@github.com/hasura/v3-e2e-testing?ref=jesse/update-mongodb";
name = "v3-e2e-testing-source";
ref = "jesse/update-mongodb";
rev = "325240c938c253a21f2fe54161b0c94e54f1a3a5";
};

v3-e2e-testing = pkgs.pkgsCross.linux.callPackage ../nix/v3-e2e-testing.nix { src = v3-e2e-testing-source; database-to-test = "mongodb"; };

e2e-testing-service = {
useHostStore = true;
command = [
"${pkgs.pkgsCross.linux.v3-e2e-testing}/bin/v3-e2e-testing-mongodb"
"${v3-e2e-testing}/bin/v3-e2e-testing-mongodb"
];
environment = pkgs.lib.optionalAttrs (engine-graphql-url != null) {
ENGINE_GRAPHQL_URL = engine-graphql-url;
Expand Down
20 changes: 1 addition & 19 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@
url = "github:hasura/graphql-engine/50f1243a46e22f0fecca03364b0b181fbb3735c6";
flake = false;
};

# See the note above on graphql-engine-source for information on running
# against a version of v3-e2e-testing with local changes.
v3-e2e-testing-source = {
url = "git+ssh://git@github.com/hasura/v3-e2e-testing?ref=jesse/update-mongodb";
flake = false;
};
};

outputs =
Expand All @@ -70,7 +63,6 @@
, arion
, graphql-engine-source
, dev-auth-webhook-source
, v3-e2e-testing-source
, systems
, ...
}:
Expand Down Expand Up @@ -100,8 +92,6 @@
mongodb-connector = final.mongodb-connector-workspace.override { package = "mongodb-connector"; }; # override `package` to build one specific crate
mongodb-cli-plugin = final.mongodb-connector-workspace.override { package = "mongodb-cli-plugin"; };
graphql-engine = final.callPackage ./nix/graphql-engine.nix { src = "${graphql-engine-source}/v3"; package = "engine"; };
v3-e2e-testing = final.callPackage ./nix/v3-e2e-testing.nix { src = v3-e2e-testing-source; database-to-test = "mongodb"; };
inherit v3-e2e-testing-source; # include this source so we can read files from it in arion-compose configs
dev-auth-webhook = final.callPackage ./nix/dev-auth-webhook.nix { src = "${dev-auth-webhook-source}/v3/crates/hasura-authn-webhook/dev-auth-webhook"; };

# Provide cross-compiled versions of each of our packages under
Expand Down

0 comments on commit 8b61723

Please sign in to comment.