From e0c2d3e68fa07e7aa8d9477a7c2f6f4496e6b4bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Sun, 17 Mar 2024 11:15:04 +0000 Subject: [PATCH] more test fixes --- examples/phoenix/.test.sh | 10 +--------- examples/phoenix/devenv.nix | 12 +++++++++--- examples/supported-languages/.setup.sh | 2 ++ examples/vala/devenv.nix | 2 +- tests/glibcLocales/devenv.nix | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) create mode 100755 examples/supported-languages/.setup.sh diff --git a/examples/phoenix/.test.sh b/examples/phoenix/.test.sh index 95a374e03..2d7954b4f 100755 --- a/examples/phoenix/.test.sh +++ b/examples/phoenix/.test.sh @@ -1,12 +1,4 @@ -#!/usr/bin/env bash set -ex -mix local.hex --force -mix local.rebar --force -echo Y | mix archive.install hex phx_new -echo Y | mix phx.new hello -sed -i.bak -e "s/username: \"postgres\",/socket_dir: System.get_env(\"PGDATA\"),/" \ - ./hello/config/dev.exs && rm ./hello/config/dev.exs.bak - wait_for_port 4000 -curl -s http://localhost:4000/ | grep "Phoenix Framework" +curl -s http://localhost:4000/ | grep "Phoenix Framework" \ No newline at end of file diff --git a/examples/phoenix/devenv.nix b/examples/phoenix/devenv.nix index a5ce5f7b3..738320a1c 100644 --- a/examples/phoenix/devenv.nix +++ b/examples/phoenix/devenv.nix @@ -1,13 +1,19 @@ { pkgs, lib, ... }: { - # this example is currently broken - packages = lib.optionals pkgs.stdenv.isLinux [ pkgs.inotify-tools ]; languages.elixir.enable = true; services.postgres.enable = true; - processes.phoenix.exec = "mix ecto.create && mix phx.server"; + processes.phoenix.exec = "cd hello && mix deps.get && mix ecto.create && mix phx.server"; + process.before = '' + mix local.hex --force + mix local.rebar --force + echo Y | mix archive.install hex phx_new + echo Y | mix phx.new hello + sed -i.bak -e "s/username: \"postgres\",/socket_dir: System.get_env(\"PGDATA\"),/" \ + ./hello/config/dev.exs && rm ./hello/config/dev.exs.bak + ''; } diff --git a/examples/supported-languages/.setup.sh b/examples/supported-languages/.setup.sh new file mode 100755 index 000000000..ad316a438 --- /dev/null +++ b/examples/supported-languages/.setup.sh @@ -0,0 +1,2 @@ +# arm is not supported yet +echo "{ pkgs, ... }: { languages.unison.enable = !(stdenv.isLinux && stdenv.isAarch64); }" > devenv.local.nix \ No newline at end of file diff --git a/examples/vala/devenv.nix b/examples/vala/devenv.nix index 4525b58f4..3d5ba50cb 100644 --- a/examples/vala/devenv.nix +++ b/examples/vala/devenv.nix @@ -3,7 +3,7 @@ { packages = with pkgs; [ # Check Vala code files for code-style errors - vala-lint + # vala-lint ]; languages = { diff --git a/tests/glibcLocales/devenv.nix b/tests/glibcLocales/devenv.nix index 0a16d9baa..e3f5c8a2d 100644 --- a/tests/glibcLocales/devenv.nix +++ b/tests/glibcLocales/devenv.nix @@ -1,5 +1,5 @@ { enterTest = '' - locale -a | grep "en_US.UTF-8" + locale -a | grep -E '(en_US.UTF-8|en_US.utf8)' ''; }