Skip to content
Snippets Groups Projects
Verified Commit 5cd7bbb0 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: wip web tests

parent db50aa5e
No related branches found
No related tags found
No related merge requests found
...@@ -106,13 +106,13 @@ ...@@ -106,13 +106,13 @@
gitlab = let gitlab = let
ciJobToken = builtins.getEnv "CI_JOB_TOKEN"; ciJobToken = builtins.getEnv "CI_JOB_TOKEN";
script-run-ci-tests = pkgs'.callPackage ./nix/scripts/run-ci-tests.nix {}; script-run-ci-tests = pkgs'.callPackage ./nix/scripts/run-ci-tests.nix {};
script-run-web-tests = pkgs'.callPackage ./nix/scripts/run-web-tests.nix {}; script-run-ci-web-tests = pkgs'.callPackage ./nix/scripts/run-ci-web-tests.nix {};
gitlabPackages = with pkgs';[ gitlabPackages = with pkgs';[
nodejs_21 nodejs_21
git git
script-run-ci-tests script-run-ci-tests
script-run-web-tests script-run-ci-web-tests
]; ];
in in
pkgs'.mkShell { pkgs'.mkShell {
......
...@@ -10,9 +10,6 @@ ...@@ -10,9 +10,6 @@
exit 1 exit 1
fi fi
set -x
${pkgs.coreutils}/bin/printenv
cd ''${CI_PROJECT_DIR} || exit 1 cd ''${CI_PROJECT_DIR} || exit 1
echo "This script will run tests in the project working directory: ''${CI_PROJECT_DIR}" echo "This script will run tests in the project working directory: ''${CI_PROJECT_DIR}"
......
{
pkgs,
lib,
...
}: let
in
pkgs.writeShellScriptBin "run-web-tests" ''
echo "run ci web tests"
if [ -z "''${CI_JOB_TOKEN}" ]; then
echo "You are in a CI environment, this shell is not intended for CI, but for local development"
exit 1
fi
cd ''${CI_PROJECT_DIR} || exit 1
echo "This script will run tests in the project working directory: ''${CI_PROJECT_DIR}"
echo "The command is executed in the current working directory and not in a nix derivation."
TEST_CASES_PATH="''${CI_PROJECT_DIR}/test/web/"
if ! ${pkgs.corepack}/bin/pnpm install
then
echo "Failed to install dependencies"
exit 1
fi
if ! ${pkgs.nodejs_21}/bin/node "''${TEST_CASES_PATH}/puppeteer.mjs" --browser ${pkgs.ungoogled-chromium}/bin/chromium --path "''${TEST_CASES_PATH}/test.html"
then
echo_fail "Tests failed, check your JS!"
exit 1
fi
exit 0
''
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment