From 9dbb62c015a614f69dae17d6f457a2424bd312de Mon Sep 17 00:00:00 2001 From: Ethan P Date: Wed, 19 Jun 2019 17:37:16 -0700 Subject: [PATCH] Fixed CI tests, hopefully. --- .circleci/config.yml | 5 +++-- .gitignore | 1 + test/util/runner.sh | 5 +++++ test/util/test.sh | 6 +++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8fbabec..51e73f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,6 +4,8 @@ executors: linux_alpine: docker: - image: alpine:latest + environment: + TERM: xterm commands: setup: @@ -20,7 +22,7 @@ commands: command: apk add bash python2 - run: name: "Setup: Install runtime packages." - command: apk add bat ripgrep + command: apk add bat ripgrep ncurses build: description: "Build the self-contained scripts." @@ -35,7 +37,6 @@ commands: jobs: - build: executor: linux_alpine steps: diff --git a/.gitignore b/.gitignore index 6c05dc8..58a5048 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ ._* # Project +/.circleci/.config.yml .download bin diff --git a/test/util/runner.sh b/test/util/runner.sh index b8cadf7..83f761d 100755 --- a/test/util/runner.sh +++ b/test/util/runner.sh @@ -4,6 +4,11 @@ SCRIPT="$1" DIR_SRC="${HERE}/../../src" DIR_BIN="${HERE}/../../bin" +export BAT_PAGER="" +export PAGER="cat" +export TERM="xterm" +export LANG="en_US.UTF-8" + shift case "$TEST_RUNNER_USE" in src) diff --git a/test/util/test.sh b/test/util/test.sh index 99dca87..ff59e45 100755 --- a/test/util/test.sh +++ b/test/util/test.sh @@ -30,7 +30,7 @@ fail() { ;; DIFF) - printf "\x1B[31m%s\x1B[0m\n" "$1" + printf "\x1B[33m%s\x1B[0m\n" "$2" printf "\x1B[33mDifference:\x1B[0m\n" bat --style=plain -l diff - ;; @@ -61,7 +61,7 @@ case "$1" in if [ -z "$SNAPSHOT_DIFF" ]; then pass else - fail DIFF "The current revision does not match the snapshot." + fail DIFF "The current revision does not match the snapshot." <<< "$SNAPSHOT_DIFF" fi };; @@ -72,7 +72,7 @@ case "$1" in if [ -z "$SNAPSHOT_DIFF" ]; then pass else - fail DIFF "The current built and executed scripts act differently." + fail DIFF "The current built and executed scripts act differently." <<< "$SNAPSHOT_DIFF" fi };;