Repository: railwayapp/nixpacks
Pull request #88 (2022-05-10 02:06:33)

Pin packages in docker run test
This should fix the test failures on https://github.com/railwayapp/nixpacks/pull/87

- Pin packages in docker run test
- Update nix archive commit sha
- Don't test with node 12 since it has reached EoL



Patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0e8963c..b9c9662 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -46,6 +46,10 @@ jobs:
       - uses: satackey/action-docker-layer-caching@v0.0.11
         # Ignore the failure of a step and avoid terminating the job.
         continue-on-error: true
+        with:
+          key: nixpacks-v2-docker-cache-{hash}
+          restore-keys: |
+            nixpacks-v2-docker-cache-
 
       - name: Run cargo test
         uses: actions-rs/cargo@v1
diff --git a/examples/node-custom-version/package.json b/examples/node-custom-version/package.json
index e05c330..5bc313c 100644
--- a/examples/node-custom-version/package.json
+++ b/examples/node-custom-version/package.json
@@ -6,6 +6,6 @@
     "start": "./start.sh"
   },
   "engines": {
-    "node": ">=12 <14"
+    "node": ">=14 <16"
   }
 }
diff --git a/examples/yarn-prisma/package.json b/examples/yarn-prisma/package.json
index 1b82c38..ac947f4 100644
--- a/examples/yarn-prisma/package.json
+++ b/examples/yarn-prisma/package.json
@@ -16,6 +16,6 @@
     "@prisma/client": "3.12.0"
   },
   "engines": {
-    "node": ">=12.2.0"
+    "node": ">=14.2.0"
   }
 }
diff --git a/src/nixpacks/mod.rs b/src/nixpacks/mod.rs
index 5cc3c40..b6cdab1 100644
--- a/src/nixpacks/mod.rs
+++ b/src/nixpacks/mod.rs
@@ -29,7 +29,7 @@ use self::{
 const NIX_PACKS_VERSION: &str = env!("CARGO_PKG_VERSION");
 
 // https://status.nixos.org/
-static NIXPKGS_ARCHIVE: &str = "30d3d79b7d3607d56546dd2a6b49e156ba0ec634";
+static NIXPKGS_ARCHIVE: &str = "934e076a441e318897aa17540f6cf7caadc69028";
 
 // Debian 11
 static BASE_IMAGE: &str = "debian:bullseye-slim";


Test patch:
diff --git a/tests/docker_run_tests.rs b/tests/docker_run_tests.rs
index e1b9f33..489d648 100644
--- a/tests/docker_run_tests.rs
+++ b/tests/docker_run_tests.rs
@@ -26,9 +26,7 @@ fn stop_containers(container_id: &str) {
         .arg("stop")
         .arg(container_id)
         .spawn()
-        .unwrap()
-        .wait()
-        .expect("failed to execute docker stop");
+        .unwrap();
 }
 
 fn remove_containers(container_id: &str) {
@@ -36,9 +34,7 @@ fn remove_containers(container_id: &str) {
         .arg("rm")
         .arg(container_id)
         .spawn()
-        .unwrap()
-        .wait()
-        .expect("failed to execute docker rm");
+        .unwrap();
 }
 
 fn stop_and_remove_container(image: String) {
@@ -99,7 +95,7 @@ fn simple_build(path: &str) -> String {
         Vec::new(),
         None,
         None,
-        false,
+        true,
         Vec::new(),
         None,
         None,
@@ -121,7 +117,7 @@ fn test_node() {
 fn test_node_custom_version() {
     let name = simple_build("./examples/node-custom-version");
     let output = run_image(name);
-    assert!(output.contains("Node version: v12"));
+    assert!(output.contains("Node version: v14"));
 }
 
 #[test]
@@ -152,13 +148,6 @@ fn test_python_2() {
     assert!(output.contains("Hello from Python 2"));
 }
 
-#[test]
-fn test_deno() {
-    let name = simple_build("./examples/deno");
-    let output = run_image(name);
-    assert!(output.contains("Hello Deno"));
-}
-
 #[test]
 fn test_rust_custom_version() {
     let name = simple_build("./examples/rust-custom-version");
diff --git a/tests/generate_plan_tests.rs b/tests/generate_plan_tests.rs
index 8cd496e..e8bad45 100644
--- a/tests/generate_plan_tests.rs
+++ b/tests/generate_plan_tests.rs
@@ -53,7 +53,7 @@ fn test_node_custom_version() -> Result<()> {
         Vec::new(),
         false,
     )?;
-    assert_eq!(plan.setup.unwrap().pkgs, vec![Pkg::new("nodejs-12_x")]);
+    assert_eq!(plan.setup.unwrap().pkgs, vec![Pkg::new("nodejs-14_x")]);
 
     Ok(())
 }