Skip to content

Commit

Permalink
Merge pull request #1403 from input-output-hk/lc/test-executables
Browse files Browse the repository at this point in the history
Use test executables instead of test-suites
  • Loading branch information
locallycompact committed Apr 19, 2024
2 parents 29159d9 + 9c57c78 commit 120ff1b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 17 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/ci-nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,16 @@ jobs:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: ❓ Test
if: ${{ matrix.package != 'hydra-tui' }}
- name: ❓ Test (Pure)
if: ${{ matrix.package == 'hydra-plutus'
|| matrix.package == 'plutus-cbor'
|| matrix.package == 'plutus-merkle-tree' }}
run: |
nix build .#checks.x86_64-linux.${{ matrix.package }}
- name: ❓ Test (Impure)
if: ${{ matrix.package == 'hydra-cluster'
|| matrix.package == 'hydra-node' }}
run: |
cd ${{ matrix.package }}
nix build .#${{ matrix.package }}-tests
Expand Down
15 changes: 15 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,21 @@
];
treefmt = pkgs.treefmt;
};
hydra-plutus = lu.tee-check {
name = "hydra-plutus";
src = self;
exe = "${packages.hydra-plutus-tests}/bin/tests";
};
plutus-cbor = lu.tee-check {
name = "plutus-cbor";
src = self;
exe = "${packages.plutus-cbor-tests}/bin/tests";
};
plutus-merkle-tree = lu.tee-check {
name = "plutus-merkle-tree";
src = self;
exe = "${packages.plutus-merkle-tree-tests}/bin/tests";
};
};

devShells = import ./nix/hydra/shell.nix {
Expand Down
2 changes: 1 addition & 1 deletion hydra-plutus/hydra-plutus.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ library
, template-haskell
, time

test-suite tests
executable tests
import: project-config
ghc-options: -threaded -rtsopts -with-rtsopts=-N
hs-source-dirs: test
Expand Down
16 changes: 4 additions & 12 deletions nix/hydra/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,10 @@ rec {

hydraw-static = musl64Pkgs.hydraw.components.exes.hydraw;

plutus-cbor-tests = pkgs.mkShellNoCC {
name = "plutus-cbor-tests";
buildInputs = [ nativePkgs.plutus-cbor.components.tests.tests ];
};
plutus-merkle-tree-tests = pkgs.mkShellNoCC {
name = "plutus-merkle-tree-tests";
buildInputs = [ nativePkgs.plutus-merkle-tree.components.tests.tests ];
};
hydra-plutus-tests = pkgs.mkShellNoCC {
name = "hydra-plutus-tests";
buildInputs = [ nativePkgs.hydra-plutus.components.tests.tests ];
};
plutus-cbor-tests = nativePkgs.plutus-cbor.components.exes.tests;

plutus-merkle-tree-tests = nativePkgs.plutus-merkle-tree.components.exes.tests;
hydra-plutus-tests = nativePkgs.hydra-plutus.components.exes.tests;
hydra-node-tests = pkgs.mkShellNoCC {
name = "hydra-node-tests";
buildInputs = [
Expand Down
2 changes: 1 addition & 1 deletion plutus-cbor/plutus-cbor.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ library

exposed-modules: Plutus.Codec.CBOR.Encoding

test-suite tests
executable tests
import: project-config
type: exitcode-stdio-1.0
hs-source-dirs: test
Expand Down
2 changes: 1 addition & 1 deletion plutus-merkle-tree/plutus-merkle-tree.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ library
, plutus-tx
, text

test-suite tests
executable tests
import: project-config
type: exitcode-stdio-1.0
hs-source-dirs: test
Expand Down

0 comments on commit 120ff1b

Please sign in to comment.