integrate crane cargo tests with woodpecker
This commit is contained in:
parent
b96db0bc7c
commit
5c39144902
3 changed files with 17 additions and 23 deletions
|
@ -16,7 +16,7 @@ steps:
|
|||
- name: build
|
||||
image: nixpkgs/nix:nixos-22.05
|
||||
commands:
|
||||
- nix-build -j4 --no-build-output --attr pkgs.amd64.debug --argstr git_version ${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
|
||||
- nix-build -j4 --no-build-output --attr flakePackages.dev
|
||||
|
||||
- name: unit + func tests
|
||||
image: nixpkgs/nix:nixos-22.05
|
||||
|
@ -24,26 +24,12 @@ steps:
|
|||
GARAGE_TEST_INTEGRATION_EXE: result-bin/bin/garage
|
||||
GARAGE_TEST_INTEGRATION_PATH: tmp-garage-integration
|
||||
commands:
|
||||
- nix-build -j4 --no-build-output --attr test.amd64 --argstr git_version ${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
|
||||
- ./result/bin/garage_db-*
|
||||
- ./result/bin/garage_api_common-*
|
||||
- ./result/bin/garage_api_s3-*
|
||||
- ./result/bin/garage_api_k2v-*
|
||||
- ./result/bin/garage_api_admin-*
|
||||
- ./result/bin/garage_model-*
|
||||
- ./result/bin/garage_rpc-*
|
||||
- ./result/bin/garage_table-*
|
||||
- ./result/bin/garage_util-*
|
||||
- ./result/bin/garage_web-*
|
||||
- ./result/bin/garage-*
|
||||
- GARAGE_TEST_INTEGRATION_DB_ENGINE=lmdb ./result/bin/integration-* || (cat tmp-garage-integration/stderr.log; false)
|
||||
- nix-shell --attr ci --run "killall -9 garage" || true
|
||||
- GARAGE_TEST_INTEGRATION_DB_ENGINE=sqlite ./result/bin/integration-* || (cat tmp-garage-integration/stderr.log; false)
|
||||
- nix-build -j4 --no-build-output --attr flakePackages.tests-lmdb
|
||||
- nix-build -j4 --no-build-output --attr flakePackages.tests-sqlite
|
||||
- rm result
|
||||
- rm -rv tmp-garage-integration
|
||||
|
||||
- name: integration tests
|
||||
image: nixpkgs/nix:nixos-22.05
|
||||
commands:
|
||||
- nix-build -j4 --no-build-output --attr pkgs.amd64.debug --argstr git_version ${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
|
||||
- nix-build -j4 --no-build-output --attr flakePackages.dev
|
||||
- nix-shell --attr ci --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
|
||||
|
|
15
flake.nix
15
flake.nix
|
@ -26,6 +26,10 @@
|
|||
packageFor = target: release: (compile {
|
||||
inherit system git_version target nixpkgs crane rust-overlay release;
|
||||
}).garage;
|
||||
testWith = extraTestEnv: (compile {
|
||||
inherit system git_version nixpkgs crane rust-overlay extraTestEnv;
|
||||
release = false;
|
||||
}).garage-test;
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
|
@ -42,10 +46,13 @@
|
|||
dev = packageFor null false;
|
||||
|
||||
# test = cargo test
|
||||
tests = (compile {
|
||||
inherit system git_version nixpkgs crane rust-overlay;
|
||||
release = false;
|
||||
}).garage-test;
|
||||
tests = testWith {};
|
||||
tests-lmdb = testWith {
|
||||
GARAGE_TEST_INTEGRATION_DB_ENGINE = "lmdb";
|
||||
};
|
||||
tests-sqlite = testWith {
|
||||
GARAGE_TEST_INTEGRATION_DB_ENGINE = "sqlite";
|
||||
};
|
||||
};
|
||||
|
||||
# ---- developpment shell, for making native builds only ----
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
target ? null,
|
||||
release ? false,
|
||||
features ? null,
|
||||
extraTestEnv ? {}
|
||||
}:
|
||||
|
||||
let
|
||||
|
@ -185,5 +186,5 @@ in rec {
|
|||
nativeBuildInputs = commonArgs.nativeBuildInputs ++ [
|
||||
pkgs.cacert
|
||||
];
|
||||
});
|
||||
} // extraTestEnv);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue