From ab1223640f90241ed4fff2917b4d5d4351684a62 Mon Sep 17 00:00:00 2001
From: Daniel Salazar <podany270895@gmail.com>
Date: Wed, 18 Dec 2024 20:40:16 -0500
Subject: [PATCH] refac(cross): #1223 restructure tests

- Move container to root directory
- Move tests to root directory
- Move utils to root directory
- Create an isolated namespace per test
- Adapt CI jobs

Signed-off-by: Daniel Salazar <podany270895@gmail.com>
---
 .github/workflows/dev.yml                     |  20 +--
 .github/workflows/prod.yml                    |  24 +---
 .../container-image => container}/makes.nix   |  51 ++++++-
 makes.nix                                     | 136 ++----------------
 makes/makes.nix                               |  14 +-
 test/dev/.envrc                               |   2 -
 {makes/tests => tests}/commitlint/config.js   |   0
 {makes/tests => tests}/commitlint/makes.nix   |   2 +-
 {makes/tests => tests}/commitlint/parser.js   |   0
 .../computeOnAwsBatch/makes.nix               |   0
 tests/helloWorld/makes.nix                    |   6 +
 .../lintWithAjv}/data.json                    |   0
 .../lintWithAjv}/data.yaml                    |   0
 tests/lintWithAjv/makes.nix                   |   9 ++
 .../lintWithAjv}/schema.json                  |   0
 {makes/tests => tests}/makeScript/README.md   |   2 +-
 {makes/tests => tests}/makeScript/makes.nix   |   0
 .../tests => tests}/makeSearchPaths/makes.nix |   0
 .../makeSearchPaths/template.sh               |   0
 {makes/tests => tests}/makeTemplate/makes.nix |   0
 .../tests => tests}/makeTemplate/template.txt |   0
 {makes/tests => tests}/makeTemplate/test.yaml |   0
 tests/makes.nix                               |  13 ++
 {test => tests}/pipelines/.gitlab-ci.yaml     |   0
 tests/pipelines/makes.nix                     |  17 +++
 tests/secretsForEnvFromSops/makes.nix         |   8 ++
 .../secretsForGpgFromEnv/makes.nix            |   9 ++
 .../tests => tests}/secretsForGpgFromEnv/pgp  |   0
 .../secretsForGpgFromEnv/pgp.pub              |   0
 .../secretsForGpgFromEnv/secrets.yaml         |   0
 tests/terraform/makes.nix                     |  32 +++++
 {test => tests}/terraform/module/main.tf      |   0
 .../makePythonLock/entrypoint.sh              |   0
 .../utils => utils}/makePythonLock/makes.nix  |   0
 .../makeRubyLock/entrypoint.sh                |   0
 {makes/utils => utils}/makeRubyLock/makes.nix |   0
 {makes/utils => utils}/makeRubyLock/parser.rb |   0
 utils/makes.nix                               |   1 +
 38 files changed, 162 insertions(+), 184 deletions(-)
 rename {makes/container-image => container}/makes.nix (79%)
 delete mode 100644 test/dev/.envrc
 rename {makes/tests => tests}/commitlint/config.js (100%)
 rename {makes/tests => tests}/commitlint/makes.nix (92%)
 rename {makes/tests => tests}/commitlint/parser.js (100%)
 rename {makes/tests => tests}/computeOnAwsBatch/makes.nix (100%)
 create mode 100644 tests/helloWorld/makes.nix
 rename {test/lint-with-ajv => tests/lintWithAjv}/data.json (100%)
 rename {test/lint-with-ajv => tests/lintWithAjv}/data.yaml (100%)
 create mode 100644 tests/lintWithAjv/makes.nix
 rename {test/lint-with-ajv => tests/lintWithAjv}/schema.json (100%)
 rename {makes/tests => tests}/makeScript/README.md (82%)
 rename {makes/tests => tests}/makeScript/makes.nix (100%)
 rename {makes/tests => tests}/makeSearchPaths/makes.nix (100%)
 rename {makes/tests => tests}/makeSearchPaths/template.sh (100%)
 rename {makes/tests => tests}/makeTemplate/makes.nix (100%)
 rename {makes/tests => tests}/makeTemplate/template.txt (100%)
 rename {makes/tests => tests}/makeTemplate/test.yaml (100%)
 create mode 100644 tests/makes.nix
 rename {test => tests}/pipelines/.gitlab-ci.yaml (100%)
 create mode 100644 tests/pipelines/makes.nix
 create mode 100644 tests/secretsForEnvFromSops/makes.nix
 rename {makes/tests => tests}/secretsForGpgFromEnv/makes.nix (51%)
 rename {makes/tests => tests}/secretsForGpgFromEnv/pgp (100%)
 rename {makes/tests => tests}/secretsForGpgFromEnv/pgp.pub (100%)
 rename {makes/tests => tests}/secretsForGpgFromEnv/secrets.yaml (100%)
 create mode 100644 tests/terraform/makes.nix
 rename {test => tests}/terraform/module/main.tf (100%)
 rename {makes/utils => utils}/makePythonLock/entrypoint.sh (100%)
 rename {makes/utils => utils}/makePythonLock/makes.nix (100%)
 rename {makes/utils => utils}/makeRubyLock/entrypoint.sh (100%)
 rename {makes/utils => utils}/makeRubyLock/makes.nix (100%)
 rename {makes/utils => utils}/makeRubyLock/parser.rb (100%)
 create mode 100644 utils/makes.nix

diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml
index 3370b93d..8bacd111 100644
--- a/.github/workflows/dev.yml
+++ b/.github/workflows/dev.yml
@@ -35,22 +35,6 @@ jobs:
       - name: /deployTerraform/module
         run: nix-env -if . && m . /deployTerraform/module
 
-  linux_dev_example:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
-      - uses: docker://docker.io/nixos/nix@sha256:c3db4c484f6b1ee6c9bb8ca90307cfbeca8ef88156840911356a677eeaff4845
-        name: /dev/example
-        with:
-          args: sh -c "chown -R root:root /github/workspace && nix-env -if . && m . /dev/example"
-  macos_dev_example:
-    runs-on: macos-latest
-    steps:
-      - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
-      - uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac
-      - name: /dev/example
-        run: nix-env -if . && m . /dev/example
-
   linux_dev_makes:
     runs-on: ubuntu-latest
     steps:
@@ -388,7 +372,7 @@ jobs:
       - name: /testTerraform/module
         run: nix-env -if . && m . /testTerraform/module
 
-  linux_computeOnAwsBatch_module:
+  linux_tests_computeOnAwsBatch:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
@@ -396,7 +380,7 @@ jobs:
         name: /tests/computeOnAwsBatch
         with:
           args: sh -c "chown -R root:root /github/workspace && nix-env -if . && m . /tests/computeOnAwsBatch
-  macos_computeOnAwsBatch_module:
+  macos_tests_computeOnAwsBatch:
     runs-on: macos-latest
     steps:
       - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml
index b902c5c2..88e30da3 100644
--- a/.github/workflows/prod.yml
+++ b/.github/workflows/prod.yml
@@ -122,26 +122,6 @@ jobs:
         env:
           CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
 
-  linux_dev_example:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
-      - uses: docker://docker.io/nixos/nix@sha256:c3db4c484f6b1ee6c9bb8ca90307cfbeca8ef88156840911356a677eeaff4845
-        name: /dev/example
-        with:
-          args: sh -c "chown -R root:root /github/workspace && nix-env -if . && m . /dev/example"
-        env:
-          CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
-  macos_dev_example:
-    runs-on: macos-latest
-    steps:
-      - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
-      - uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac
-      - name: /dev/example
-        run: nix-env -if . && m . /dev/example
-        env:
-          CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
-
   linux_docs_deploy:
     runs-on: ubuntu-latest
     steps:
@@ -544,7 +524,7 @@ jobs:
         env:
           CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
 
-  linux_computeOnAwsBatch_module:
+  linux_tests_computeOnAwsBatch:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
@@ -552,7 +532,7 @@ jobs:
         name: /tests/computeOnAwsBatch
         with:
           args: sh -c "chown -R root:root /github/workspace && nix-env -if . && m . /tests/computeOnAwsBatch
-  macos_computeOnAwsBatch_module:
+  macos_tests_computeOnAwsBatch:
     runs-on: macos-latest
     steps:
       - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
diff --git a/makes/container-image/makes.nix b/container/makes.nix
similarity index 79%
rename from makes/container-image/makes.nix
rename to container/makes.nix
index 13867708..8638caac 100644
--- a/makes/container-image/makes.nix
+++ b/container/makes.nix
@@ -1,5 +1,52 @@
 { outputs, __nixpkgs__, ... }: {
-  jobs."/container-image" = __nixpkgs__.dockerTools.buildImage {
+  deployContainer = {
+    makesAmd64 = {
+      credentials = {
+        token = "GITHUB_TOKEN";
+        user = "GITHUB_ACTOR";
+      };
+      image = "ghcr.io/fluidattacks/makes:amd64";
+      src = outputs."/container";
+      sign = true;
+    };
+    makesArm64 = {
+      credentials = {
+        token = "GITHUB_TOKEN";
+        user = "GITHUB_ACTOR";
+      };
+      image = "ghcr.io/fluidattacks/makes:arm64";
+      src = outputs."/container";
+      sign = true;
+    };
+  };
+  deployContainerManifest = {
+    makes = {
+      credentials = {
+        token = "GITHUB_TOKEN";
+        user = "GITHUB_ACTOR";
+      };
+      image = "ghcr.io/fluidattacks/makes:latest";
+      manifests = [
+        {
+          image = "ghcr.io/fluidattacks/makes:amd64";
+          platform = {
+            architecture = "amd64";
+            os = "linux";
+          };
+        }
+        {
+          image = "ghcr.io/fluidattacks/makes:arm64";
+          platform = {
+            architecture = "arm64";
+            os = "linux";
+          };
+        }
+      ];
+      sign = true;
+      tags = [ "24.12" ];
+    };
+  };
+  jobs."/container" = __nixpkgs__.dockerTools.buildImage {
     config = {
       Env = [
         "HOME=/home/root"
@@ -24,7 +71,7 @@
       User = "root:root";
       WorkingDir = "/working-dir";
     };
-    name = "container-image";
+    name = "container";
     tag = "latest";
 
     copyToRoot = __nixpkgs__.buildEnv {
diff --git a/makes.nix b/makes.nix
index 8940bdae..e7724d4f 100644
--- a/makes.nix
+++ b/makes.nix
@@ -1,7 +1,4 @@
-{ fetchNixpkgs, fetchUrl, makeScript, outputs, projectPath, __nixpkgs__, ...
-}: {
-  imports = [ ./docs/makes.nix ./makes/makes.nix ];
-  projectIdentifier = "makes-repo";
+{ fetchNixpkgs, outputs, __nixpkgs__, ... }: {
   cache = {
     readNixos = true;
     extra = {
@@ -16,77 +13,12 @@
       };
     };
   };
-  deployContainer = {
-    makesAmd64 = {
-      credentials = {
-        token = "GITHUB_TOKEN";
-        user = "GITHUB_ACTOR";
-      };
-      image = "ghcr.io/fluidattacks/makes:amd64";
-      src = outputs."/container-image";
-      sign = true;
-    };
-    makesArm64 = {
-      credentials = {
-        token = "GITHUB_TOKEN";
-        user = "GITHUB_ACTOR";
-      };
-      image = "ghcr.io/fluidattacks/makes:arm64";
-      src = outputs."/container-image";
-      sign = true;
-    };
-  };
-  deployContainerManifest = {
-    makes = {
-      credentials = {
-        token = "GITHUB_TOKEN";
-        user = "GITHUB_ACTOR";
-      };
-      image = "ghcr.io/fluidattacks/makes:latest";
-      manifests = [
-        {
-          image = "ghcr.io/fluidattacks/makes:amd64";
-          platform = {
-            architecture = "amd64";
-            os = "linux";
-          };
-        }
-        {
-          image = "ghcr.io/fluidattacks/makes:arm64";
-          platform = {
-            architecture = "arm64";
-            os = "linux";
-          };
-        }
-      ];
-      sign = true;
-      tags = [ "24.12" ];
-    };
-  };
-  deployTerraform = {
-    modules = {
-      module = {
-        src = "/test/terraform/module";
-        version = "1.0";
-      };
-    };
-  };
   dev = {
-    example = { bin = [ __nixpkgs__.hello ]; };
     makes = {
       bin = [ __nixpkgs__.just __nixpkgs__.reuse ];
       source = [ outputs."/cli/env/runtime" ];
     };
   };
-  envVars = {
-    example = {
-      # Don't do this in production, it's unsafe. We do this for testing purposes.
-      PGP_PRIVATE = builtins.readFile ./makes/tests/secretsForGpgFromEnv/pgp;
-      PGP_PUBLIC = builtins.readFile ./makes/tests/secretsForGpgFromEnv/pgp.pub;
-      VAR_NAME = "test";
-    };
-  };
-  envVarsForTerraform = { example = { VAR_NAME = "test"; }; };
   extendingMakesDirs = [ "/makes" ];
   formatBash = {
     enable = true;
@@ -104,10 +36,13 @@
     enable = true;
     targets = [ "/" ];
   };
-  helloWorld = {
-    enable = true;
-    name = "Jane Doe";
-  };
+  imports = [
+    ./container/makes.nix
+    ./docs/makes.nix
+    ./makes/makes.nix
+    ./tests/makes.nix
+    ./utils/makes.nix
+  ];
   inputs = {
     nixpkgs = fetchNixpkgs {
       rev = "f88fc7a04249cf230377dd11e04bf125d45e9abe";
@@ -118,60 +53,11 @@
     enable = true;
     targets = [ "/" ];
   };
-  lintGitMailMap = { enable = true; };
+  lintGitMailMap.enable = true;
   lintNix = {
     enable = true;
     targets = [ "/" ];
   };
-  lintTerraform = {
-    modules = {
-      module = {
-        src = "/test/terraform/module";
-        version = "1.0";
-      };
-    };
-  };
-  lintWithAjv = {
-    "test" = {
-      schema = "/test/lint-with-ajv/schema.json";
-      targets =
-        [ "/test/lint-with-ajv/data.json" "/test/lint-with-ajv/data.yaml" ];
-    };
-  };
-  pipelines = {
-    example = {
-      gitlabPath = "/test/pipelines/.gitlab-ci.yaml";
-      jobs = [
-        {
-          output = "/lintNix";
-          args = [ ];
-        }
-        {
-          output = "/helloWorld";
-          args = [ "1" "2" "3" ];
-        }
-      ];
-    };
-  };
-  secretsForGpgFromEnv = { example = [ "PGP_PUBLIC" "PGP_PRIVATE" ]; };
-  secretsForEnvFromSops = {
-    example = {
-      manifest = "/makes/tests/secretsForGpgFromEnv/secrets.yaml";
-      vars = [ "secret" ];
-    };
-  };
-  secretsForTerraformFromEnv = { example = { test = "VAR_NAME"; }; };
-  testLicense = { enable = true; };
-  testTerraform = {
-    modules = {
-      module = {
-        setup = [
-          outputs."/envVars/example"
-          outputs."/secretsForTerraformFromEnv/example"
-        ];
-        src = "/test/terraform/module";
-        version = "1.0";
-      };
-    };
-  };
+  projectIdentifier = "makes-repo";
+  testLicense.enable = true;
 }
diff --git a/makes/makes.nix b/makes/makes.nix
index 1d459a05..395371a0 100644
--- a/makes/makes.nix
+++ b/makes/makes.nix
@@ -1,19 +1,7 @@
 { __nixpkgs__, makeScript, outputs, projectPath, ... }:
 let makesVersion = "24.12";
 in {
-  imports = [
-    ./cli/env/runtime/makes.nix
-    ./cli/env/runtime/pypi/makes.nix
-    ./container-image/makes.nix
-    ./tests/commitlint/makes.nix
-    ./tests/computeOnAwsBatch/makes.nix
-    ./tests/makeScript/makes.nix
-    ./tests/makeSearchPaths/makes.nix
-    ./tests/makeTemplate/makes.nix
-    ./tests/secretsForGpgFromEnv/makes.nix
-    ./utils/makePythonLock/makes.nix
-    ./utils/makeRubyLock/makes.nix
-  ];
+  imports = [ ./cli/env/runtime/makes.nix ./cli/env/runtime/pypi/makes.nix ];
 
   jobs."/" = makeScript {
     aliases = [ "m-v${makesVersion}" "makes" "makes-v${makesVersion}" ];
diff --git a/test/dev/.envrc b/test/dev/.envrc
deleted file mode 100644
index dc2e7605..00000000
--- a/test/dev/.envrc
+++ /dev/null
@@ -1,2 +0,0 @@
-cd ../../
-source "$(m . /dev/example)/template"
diff --git a/makes/tests/commitlint/config.js b/tests/commitlint/config.js
similarity index 100%
rename from makes/tests/commitlint/config.js
rename to tests/commitlint/config.js
diff --git a/makes/tests/commitlint/makes.nix b/tests/commitlint/makes.nix
similarity index 92%
rename from makes/tests/commitlint/makes.nix
rename to tests/commitlint/makes.nix
index effe267f..77a9a834 100644
--- a/makes/tests/commitlint/makes.nix
+++ b/tests/commitlint/makes.nix
@@ -2,7 +2,7 @@
   jobs."/tests/commitlint" = makeScript {
     name = "commitlint";
     entrypoint = ''
-      pushd makes/tests/commitlint
+      pushd tests/commitlint
 
       commit_hash="$(git --no-pager log --pretty=%h origin/main..HEAD)"
 
diff --git a/makes/tests/commitlint/parser.js b/tests/commitlint/parser.js
similarity index 100%
rename from makes/tests/commitlint/parser.js
rename to tests/commitlint/parser.js
diff --git a/makes/tests/computeOnAwsBatch/makes.nix b/tests/computeOnAwsBatch/makes.nix
similarity index 100%
rename from makes/tests/computeOnAwsBatch/makes.nix
rename to tests/computeOnAwsBatch/makes.nix
diff --git a/tests/helloWorld/makes.nix b/tests/helloWorld/makes.nix
new file mode 100644
index 00000000..55b56697
--- /dev/null
+++ b/tests/helloWorld/makes.nix
@@ -0,0 +1,6 @@
+{
+  helloWorld = {
+    enable = true;
+    name = "Jane Doe";
+  };
+}
diff --git a/test/lint-with-ajv/data.json b/tests/lintWithAjv/data.json
similarity index 100%
rename from test/lint-with-ajv/data.json
rename to tests/lintWithAjv/data.json
diff --git a/test/lint-with-ajv/data.yaml b/tests/lintWithAjv/data.yaml
similarity index 100%
rename from test/lint-with-ajv/data.yaml
rename to tests/lintWithAjv/data.yaml
diff --git a/tests/lintWithAjv/makes.nix b/tests/lintWithAjv/makes.nix
new file mode 100644
index 00000000..5121bdf8
--- /dev/null
+++ b/tests/lintWithAjv/makes.nix
@@ -0,0 +1,9 @@
+{
+  lintWithAjv = {
+    "test" = {
+      schema = "/tests/lintWithAjv/schema.json";
+      targets =
+        [ "/tests/lintWithAjv/data.json" "/test/lintWithAjv/data.yaml" ];
+    };
+  };
+}
diff --git a/test/lint-with-ajv/schema.json b/tests/lintWithAjv/schema.json
similarity index 100%
rename from test/lint-with-ajv/schema.json
rename to tests/lintWithAjv/schema.json
diff --git a/makes/tests/makeScript/README.md b/tests/makeScript/README.md
similarity index 82%
rename from makes/tests/makeScript/README.md
rename to tests/makeScript/README.md
index 8d63dad3..c15debdd 100644
--- a/makes/tests/makeScript/README.md
+++ b/tests/makeScript/README.md
@@ -1,6 +1,6 @@
 # A Script With a Help
 
-- This is `makes/tests/makeScript/README.md`
+- This is `tests/makeScript/README.md`
 - You might be looking at it beautifully rendered on GitHub / GitLab / etc.
 - You also might be looking at it beautifully rendedred on the CLI\*.
 
diff --git a/makes/tests/makeScript/makes.nix b/tests/makeScript/makes.nix
similarity index 100%
rename from makes/tests/makeScript/makes.nix
rename to tests/makeScript/makes.nix
diff --git a/makes/tests/makeSearchPaths/makes.nix b/tests/makeSearchPaths/makes.nix
similarity index 100%
rename from makes/tests/makeSearchPaths/makes.nix
rename to tests/makeSearchPaths/makes.nix
diff --git a/makes/tests/makeSearchPaths/template.sh b/tests/makeSearchPaths/template.sh
similarity index 100%
rename from makes/tests/makeSearchPaths/template.sh
rename to tests/makeSearchPaths/template.sh
diff --git a/makes/tests/makeTemplate/makes.nix b/tests/makeTemplate/makes.nix
similarity index 100%
rename from makes/tests/makeTemplate/makes.nix
rename to tests/makeTemplate/makes.nix
diff --git a/makes/tests/makeTemplate/template.txt b/tests/makeTemplate/template.txt
similarity index 100%
rename from makes/tests/makeTemplate/template.txt
rename to tests/makeTemplate/template.txt
diff --git a/makes/tests/makeTemplate/test.yaml b/tests/makeTemplate/test.yaml
similarity index 100%
rename from makes/tests/makeTemplate/test.yaml
rename to tests/makeTemplate/test.yaml
diff --git a/tests/makes.nix b/tests/makes.nix
new file mode 100644
index 00000000..eda51f8d
--- /dev/null
+++ b/tests/makes.nix
@@ -0,0 +1,13 @@
+{
+  imports = [
+    ./commitlint/makes.nix
+    ./computeOnAwsBatch/makes.nix
+    ./helloWorld/makes.nix
+    ./lintWithAjv/makes.nix
+    ./makeScript/makes.nix
+    ./makeSearchPaths/makes.nix
+    ./makeTemplate/makes.nix
+    ./pipelines/makes.nix
+    ./secretsForGpgFromEnv/makes.nix
+  ];
+}
diff --git a/test/pipelines/.gitlab-ci.yaml b/tests/pipelines/.gitlab-ci.yaml
similarity index 100%
rename from test/pipelines/.gitlab-ci.yaml
rename to tests/pipelines/.gitlab-ci.yaml
diff --git a/tests/pipelines/makes.nix b/tests/pipelines/makes.nix
new file mode 100644
index 00000000..fc40a042
--- /dev/null
+++ b/tests/pipelines/makes.nix
@@ -0,0 +1,17 @@
+{
+  pipelines = {
+    example = {
+      gitlabPath = "/tests/pipelines/.gitlab-ci.yaml";
+      jobs = [
+        {
+          output = "/lintNix";
+          args = [ ];
+        }
+        {
+          output = "/helloWorld";
+          args = [ "1" "2" "3" ];
+        }
+      ];
+    };
+  };
+}
diff --git a/tests/secretsForEnvFromSops/makes.nix b/tests/secretsForEnvFromSops/makes.nix
new file mode 100644
index 00000000..a0d1959e
--- /dev/null
+++ b/tests/secretsForEnvFromSops/makes.nix
@@ -0,0 +1,8 @@
+{
+  secretsForEnvFromSops = {
+    example = {
+      manifest = "/tests/secretsForGpgFromEnv/secrets.yaml";
+      vars = [ "secret" ];
+    };
+  };
+}
diff --git a/makes/tests/secretsForGpgFromEnv/makes.nix b/tests/secretsForGpgFromEnv/makes.nix
similarity index 51%
rename from makes/tests/secretsForGpgFromEnv/makes.nix
rename to tests/secretsForGpgFromEnv/makes.nix
index 88f5ebe4..4eed1981 100644
--- a/makes/tests/secretsForGpgFromEnv/makes.nix
+++ b/tests/secretsForGpgFromEnv/makes.nix
@@ -1,4 +1,12 @@
 { makeScript, outputs, ... }: {
+  envVars = {
+    example = {
+      # Don't do this in production, it's unsafe. We do this for testing purposes.
+      PGP_PRIVATE = builtins.readFile ./pgp;
+      PGP_PUBLIC = builtins.readFile ./pgp.pub;
+      VAR_NAME = "test";
+    };
+  };
   jobs."/tests/secretsForGpgFromEnv" = makeScript {
     entrypoint = "echo $secret";
     name = "tests-secrets-for-gpg-from-env";
@@ -8,4 +16,5 @@
       outputs."/secretsForEnvFromSops/example"
     ];
   };
+  secretsForGpgFromEnv.example = [ "PGP_PUBLIC" "PGP_PRIVATE" ];
 }
diff --git a/makes/tests/secretsForGpgFromEnv/pgp b/tests/secretsForGpgFromEnv/pgp
similarity index 100%
rename from makes/tests/secretsForGpgFromEnv/pgp
rename to tests/secretsForGpgFromEnv/pgp
diff --git a/makes/tests/secretsForGpgFromEnv/pgp.pub b/tests/secretsForGpgFromEnv/pgp.pub
similarity index 100%
rename from makes/tests/secretsForGpgFromEnv/pgp.pub
rename to tests/secretsForGpgFromEnv/pgp.pub
diff --git a/makes/tests/secretsForGpgFromEnv/secrets.yaml b/tests/secretsForGpgFromEnv/secrets.yaml
similarity index 100%
rename from makes/tests/secretsForGpgFromEnv/secrets.yaml
rename to tests/secretsForGpgFromEnv/secrets.yaml
diff --git a/tests/terraform/makes.nix b/tests/terraform/makes.nix
new file mode 100644
index 00000000..01b85507
--- /dev/null
+++ b/tests/terraform/makes.nix
@@ -0,0 +1,32 @@
+{ outputs, ... }: {
+  deployTerraform = {
+    modules = {
+      module = {
+        src = "/tests/terraform/module";
+        version = "1.0";
+      };
+    };
+  };
+  envVarsForTerraform.example.VAR_NAME = "test";
+  lintTerraform = {
+    modules = {
+      module = {
+        src = "/tests/terraform/module";
+        version = "1.0";
+      };
+    };
+  };
+  secretsForTerraformFromEnv = { example = { test = "VAR_NAME"; }; };
+  testTerraform = {
+    modules = {
+      module = {
+        setup = [
+          outputs."/envVars/example"
+          outputs."/secretsForTerraformFromEnv/example"
+        ];
+        src = "/tests/terraform/module";
+        version = "1.0";
+      };
+    };
+  };
+}
diff --git a/test/terraform/module/main.tf b/tests/terraform/module/main.tf
similarity index 100%
rename from test/terraform/module/main.tf
rename to tests/terraform/module/main.tf
diff --git a/makes/utils/makePythonLock/entrypoint.sh b/utils/makePythonLock/entrypoint.sh
similarity index 100%
rename from makes/utils/makePythonLock/entrypoint.sh
rename to utils/makePythonLock/entrypoint.sh
diff --git a/makes/utils/makePythonLock/makes.nix b/utils/makePythonLock/makes.nix
similarity index 100%
rename from makes/utils/makePythonLock/makes.nix
rename to utils/makePythonLock/makes.nix
diff --git a/makes/utils/makeRubyLock/entrypoint.sh b/utils/makeRubyLock/entrypoint.sh
similarity index 100%
rename from makes/utils/makeRubyLock/entrypoint.sh
rename to utils/makeRubyLock/entrypoint.sh
diff --git a/makes/utils/makeRubyLock/makes.nix b/utils/makeRubyLock/makes.nix
similarity index 100%
rename from makes/utils/makeRubyLock/makes.nix
rename to utils/makeRubyLock/makes.nix
diff --git a/makes/utils/makeRubyLock/parser.rb b/utils/makeRubyLock/parser.rb
similarity index 100%
rename from makes/utils/makeRubyLock/parser.rb
rename to utils/makeRubyLock/parser.rb
diff --git a/utils/makes.nix b/utils/makes.nix
new file mode 100644
index 00000000..c8da7eee
--- /dev/null
+++ b/utils/makes.nix
@@ -0,0 +1 @@
+{ imports = [ ./makePythonLock/makes.nix ./makeRubyLock/makes.nix ]; }