Skip to content

Commit

Permalink
Merge pull request #143 from blockfrost/mmahut/blockfrost-tests
Browse files Browse the repository at this point in the history
default: moving to blockfrost-tests
  • Loading branch information
vladimirvolek authored Feb 15, 2024
2 parents d68269d + c4057fc commit 9d9ba71
Show file tree
Hide file tree
Showing 26 changed files with 69 additions and 361 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
32 changes: 18 additions & 14 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{ pkgs ? let
{ nixpkgs ? let
lockfile = builtins.fromJSON (builtins.readFile ./flake.lock);
nixpkgs = lockfile.nodes.nixpkgs.locked;
in
import
(builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${nixpkgs.rev}.tar.gz";
(builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${nixpkgs.rev}.tar.gz";
sha256 = nixpkgs.narHash;
}),
pkgs ? import nixpkgs {}
, blockfrost-tests ?
(builtins.fetchGit {
url = "ssh://[email protected]/blockfrost/blockfrost-tests.git";
rev = "f405b3a27aa6bcc31c7e75a4c549448fc7686fc0";
})
{ }
, system ? builtins.currentSystem
}:
let
Expand Down Expand Up @@ -65,7 +69,7 @@ in
imports = [ ./nixos-module.nix ];
# We have to increase memsize, otherwise we will get error:
# "Kernel panic - not syncing: Out of memory: compulsory panic_on_oom"
virtualisation.memorySize = 4096;
virtualisation.memorySize = 8192;

services.blockfrost = {
enable = true;
Expand All @@ -85,9 +89,9 @@ in
start_all()
machine.wait_for_unit("blockfrost-backend-ryo.service")
machine.wait_for_open_port(3000)
machine.succeed("cp -r ${blockfrost-backend-ryo}/libexec/source /tmp")
machine.succeed("cp -r ${blockfrost-tests} /tmp/tests")
machine.succeed(
"cd /tmp/source && ${pkgs.yarn}/bin/yarn set version 3.6.3 && ${pkgs.yarn}/bin/yarn test-integration:mainnet"
"cd /tmp/tests && NIX_PATH=nixpkgs=${nixpkgs} nix-shell --run 'SERVER_URL=http://localhost:3000/ TEST_AUTH=false IS_CACHED=true yarn test:mainnet --run' >&2"
)
'';
};
Expand All @@ -100,7 +104,7 @@ in
imports = [ ./nixos-module.nix ];
# We have to increase memsize, otherwise we will get error:
# "Kernel panic - not syncing: Out of memory: compulsory panic_on_oom"
virtualisation.memorySize = 4096;
virtualisation.memorySize = 8192;

services.blockfrost = {
enable = true;
Expand All @@ -121,9 +125,9 @@ in
start_all()
machine.wait_for_unit("blockfrost-backend-ryo.service")
machine.wait_for_open_port(3000)
machine.succeed("cp -r ${blockfrost-backend-ryo}/libexec/source /tmp")
machine.succeed("cp -r ${blockfrost-tests} /tmp/tests")
machine.succeed(
"cd /tmp/source && ${pkgs.yarn}/bin/yarn set version 3.6.3 && ${pkgs.yarn}/bin/yarn test-integration:preview"
"cd /tmp/tests && NIX_PATH=nixpkgs=${nixpkgs} nix-shell --run 'SERVER_URL=http://localhost:3000/ TEST_AUTH=false IS_CACHED=true yarn test:preview --run' >&2"
)
'';
};
Expand All @@ -136,7 +140,7 @@ in
imports = [ ./nixos-module.nix ];
# We have to increase memsize, otherwise we will get error:
# "Kernel panic - not syncing: Out of memory: compulsory panic_on_oom"
virtualisation.memorySize = 4096;
virtualisation.memorySize = 8192;

services.blockfrost = {
enable = true;
Expand All @@ -157,9 +161,9 @@ in
start_all()
machine.wait_for_unit("blockfrost-backend-ryo.service")
machine.wait_for_open_port(3000)
machine.succeed("cp -r ${blockfrost-backend-ryo}/libexec/source /tmp")
machine.succeed("cp -r ${blockfrost-tests} /tmp/tests")
machine.succeed(
"cd /tmp/source && ${pkgs.yarn}/bin/yarn set version 3.6.3 && ${pkgs.yarn}/bin/yarn test-integration:preprod"
"cd /tmp/tests && NIX_PATH=nixpkgs=${nixpkgs} nix-shell --run 'SERVER_URL=http://localhost:3000/ TEST_AUTH=false IS_CACHED=true yarn test:preprod --run' >&2"
)
'';
};
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
"start-testnet": "cross-env-shell NODE_ENV=testnet \"yarn start\"",
"test": "cross-env NODE_OPTIONS='--max-http-header-size 32768' NODE_ENV=test vitest",
"test-badges": "make-coverage-badge --output-path ./docs/images/badge.svg",
"test-integration:mainnet": "cross-env NETWORK=mainnet vitest -c vitest.config.integration.ts --run --segfault-retry=3",
"test-integration:preprod": "cross-env NETWORK=preprod vitest -c vitest.config.integration.ts --run --segfault-retry=3",
"test-integration:preview": "cross-env NETWORK=preview vitest -c vitest.config.integration.ts --run --segfault-retry=3",
"type-check": "tsc --project tsconfig.json"
},
"dependencies": {
Expand Down Expand Up @@ -57,7 +54,6 @@
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "6.7.2",
"@vitest/coverage-c8": "^0.27",
"change-case": "^4.1.2",
"eslint": "8.49.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-import": "^2.28.1",
Expand Down
7 changes: 0 additions & 7 deletions test/integration/tests/common/routes.ts

This file was deleted.

7 changes: 0 additions & 7 deletions test/integration/tests/mainnet/routes.ts

This file was deleted.

7 changes: 0 additions & 7 deletions test/integration/tests/preprod/routes.ts

This file was deleted.

7 changes: 0 additions & 7 deletions test/integration/tests/preview/routes.ts

This file was deleted.

60 changes: 0 additions & 60 deletions test/integration/utils.ts

This file was deleted.

20 changes: 0 additions & 20 deletions vitest.config.integration.ts

This file was deleted.

Loading

0 comments on commit 9d9ba71

Please sign in to comment.