Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion bench/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion codd.cabal
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/mzabani/codd#readme>
homepage: https://github.com/mzabani/codd#readme
bug-reports: https://github.com/mzabani/codd/issues
Expand Down
2 changes: 1 addition & 1 deletion nix/install-codd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand Down
10 changes: 3 additions & 7 deletions nix/run-db-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
'';
}
7 changes: 2 additions & 5 deletions nix/run-no-db-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}
'';
}
13 changes: 4 additions & 9 deletions nix/run-system-resources-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
'';
}