From 1ef6f13dcfde0c98f1d7be50cbf7915995efc8f7 Mon Sep 17 00:00:00 2001 From: Marcelo Zabani Date: Fri, 6 Mar 2026 17:06:55 -0300 Subject: [PATCH 1/2] Prepare for v0.1.8 release --- app/Main.hs | 2 +- codd.cabal | 2 +- nix/install-codd.sh | 2 +- nix/run-db-tests.nix | 10 +++------- nix/run-no-db-tests.nix | 7 ++----- nix/run-system-resources-tests.nix | 13 ++++--------- 6 files changed, 12 insertions(+), 24 deletions(-) diff --git a/app/Main.hs b/app/Main.hs index f8c2580f..1b25cd66 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -205,4 +205,4 @@ doWork dbInfo (Add destFolder verbosity fp) = doWork dbInfo (VerifySchema verbosity fromStdin) = runCoddLoggerLevelFilter verbosity $ verifySchema dbInfo fromStdin doWork dbInfo (WriteSchema opts) = writeSchema dbInfo opts -doWork _ PrintCoddVersion = putStrLn "0.1.7" +doWork _ PrintCoddVersion = putStrLn "0.1.8" diff --git a/codd.cabal b/codd.cabal index 83dfdaf4..cc3aac57 100644 --- a/codd.cabal +++ b/codd.cabal @@ -1,7 +1,7 @@ cabal-version: 2.0 name: codd -version: 0.1.7 +version: 0.1.8 description: Codd is a simple-to-use CLI tool that applies plain postgres SQL migrations atomically with strong and automatic cross-environment schema equality checks. README at homepage: https://github.com/mzabani/codd#readme bug-reports: https://github.com/mzabani/codd/issues diff --git a/nix/install-codd.sh b/nix/install-codd.sh index 51922d0a..158856f4 100755 --- a/nix/install-codd.sh +++ b/nix/install-codd.sh @@ -22,7 +22,7 @@ then fi SRCDIR=$(mktemp -d || echo /tmp/codd-checkout-Y6fRwa_23x) -git clone --depth 1 -b v0.1.7 https://github.com/mzabani/codd.git "$SRCDIR" +git clone --depth 1 -b v0.1.8 https://github.com/mzabani/codd.git "$SRCDIR" nix-env -f "$SRCDIR/nix/install-codd-nixpkgs.nix" \ --option trusted-substituters 'https://cache.nixos.org https://cache.iog.io https://mzabani.cachix.org' \ diff --git a/nix/run-db-tests.nix b/nix/run-db-tests.nix index 92158fa6..99176afb 100644 --- a/nix/run-db-tests.nix +++ b/nix/run-db-tests.nix @@ -10,7 +10,7 @@ in nativeBuildInputs = [ postgres pkgs.bash pkgs.coreutils pkgs.glibcLocales ]; installPhase = '' patchShebangs scripts/*.sh - mkdir "$out" + mkdir $out mkdir -p local/temp-pg-data export LANG=en_US.UTF-8 export PGDATA="local/temp-pg-data" @@ -20,14 +20,10 @@ in export PGUSER="postgres" scripts/init-pg-cluster.sh ./conf/test-db trap "pg_ctl stop || true" EXIT ERR - pg_ctl -l "$out/pg_ctl_init.log" start + pg_ctl -l "pg_ctl_init.log" start scripts/wait-for-pg-ready.sh - # This isn't deterministic due to randomised testing and timing - # information in the output, so we're really - # abusing Nix's sandbox here, but it does makes life a lot easier. - ${coddtests}/bin/codd-test ${hspecArgs} 2>&1 | tee "$out/haskell-tests.log" + ${coddtests}/bin/codd-test ${hspecArgs} pg_ctl stop trap - EXIT ERR - cp -R "$PGDATA/log" "$out/pglogs" ''; } diff --git a/nix/run-no-db-tests.nix b/nix/run-no-db-tests.nix index 4acaedaf..0c511ea9 100644 --- a/nix/run-no-db-tests.nix +++ b/nix/run-no-db-tests.nix @@ -9,11 +9,8 @@ in }; nativeBuildInputs = [ pkgs.glibcLocales ]; installPhase = '' - mkdir "$out" export LANG=en_US.UTF-8 - # This isn't deterministic due to randomised testing and timing - # information in the output, so we're really - # abusing Nix's sandbox here, but it does makes life a lot easier. - ${coddtests}/bin/codd-test ${hspecArgs} 2>&1 | tee "$out/haskell-tests.log" + mkdir $out + ${coddtests}/bin/codd-test ${hspecArgs} ''; } diff --git a/nix/run-system-resources-tests.nix b/nix/run-system-resources-tests.nix index 18737343..9badfe50 100644 --- a/nix/run-system-resources-tests.nix +++ b/nix/run-system-resources-tests.nix @@ -10,7 +10,7 @@ in nativeBuildInputs = [ postgres pkgs.strace pkgs.bash pkgs.coreutils pkgs.glibcLocales ]; installPhase = '' patchShebangs scripts/*.sh - mkdir "$out" + mkdir $out mkdir -p local/temp-pg-data export LANG=en_US.UTF-8 export PGDATA="local/temp-pg-data" @@ -19,16 +19,11 @@ in export PGHOST="/tmp" export PGUSER="postgres" scripts/init-pg-cluster.sh ./conf/test-db - pg_ctl -l "$out/pg_ctl_init.log" start + pg_ctl -l "pg_ctl_init.log" start scripts/wait-for-pg-ready.sh - # This isn't deterministic due to randomised testing and timing - # information in the output, so we're really - # abusing Nix's sandbox here, but it does makes life a lot easier. strace -f -e openat,open,close -o /tmp/strace-codd-system-resources-test.log \ - ${coddtests}/bin/codd-test --match "/SystemResourcesSpecs/RUNNING" 2>&1 | tee "$out/tests-RUNNING-phase.log" + ${coddtests}/bin/codd-test --match "/SystemResourcesSpecs/RUNNING" pg_ctl stop - ${coddtests}/bin/codd-test --match "/SystemResourcesSpecs/CHECKING" 2>&1 | tee "$out/tests-CHECKING-phase.log" - cp /tmp/strace-codd-system-resources-test.log "$out/strace-codd-system-resources-test.log" - cp -R "$PGDATA/log" "$out/pglogs" + ${coddtests}/bin/codd-test --match "/SystemResourcesSpecs/CHECKING" ''; } From b070fe0db98d0ecf023157b1cbb8b395de0ccf21 Mon Sep 17 00:00:00 2001 From: Marcelo Zabani Date: Fri, 6 Mar 2026 17:25:56 -0300 Subject: [PATCH 2/2] Relax benchmark difference tolerance Have github runners become more fickle? --- bench/Main.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bench/Main.hs b/bench/Main.hs index 5137baf0..16e6493c 100644 --- a/bench/Main.hs +++ b/bench/Main.hs @@ -120,7 +120,7 @@ shouldBeF errorMsg tolerance actual expected = -- to be slightly related, so I'm assuming that's the only case when it happens. r2ShouldBe1 :: (HasCallStack) => String -> Double -> IO () r2ShouldBe1 errorMsg r2 = - unless (isNaN r2 || isInfinite r2) $ shouldBeF errorMsg 0.001 r2 1 + unless (isNaN r2 || isInfinite r2) $ shouldBeF errorMsg 1e-2 r2 1 fromSlopeAndIntercept :: V.Vector Double -> (Double, Double) fromSlopeAndIntercept v = case V.toList v of