From 99eb27484067b360fe550c3a8548d69cb213cc00 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Tue, 22 Dec 2020 17:38:33 -0500 Subject: [PATCH] Change test for docker-container detection --- .github/workflows/test-docker.yml | 3 +-- webodm.sh | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-docker.yml b/.github/workflows/test-docker.yml index 10511925..b7ba0fdd 100644 --- a/.github/workflows/test-docker.yml +++ b/.github/workflows/test-docker.yml @@ -11,8 +11,7 @@ jobs: name: Checkout - name: Build and Test - shell: 'script -q -e -c "bash {0}"' run: | docker-compose -f docker-compose.yml -f docker-compose.build.yml up --build -d ./wait-for-it.sh localhost:8000 -t 60 -- echo "WebODM is up" - docker-compose exec webapp /bin/bash -c "/webodm/webodm.sh test" \ No newline at end of file + docker-compose exec -T webapp /webodm/webodm.sh test \ No newline at end of file diff --git a/webodm.sh b/webodm.sh index 553412e8..056399d1 100755 --- a/webodm.sh +++ b/webodm.sh @@ -287,8 +287,7 @@ rebuild(){ run_tests(){ # If in a container, we run the actual test commands # otherwise we launch this command from the container - in_container=$(grep 'docker\|lxc' /proc/1/cgroup || true) - if [[ "$in_container" != "" ]]; then + if [[ -f /.dockerenv ]]; then echo -e "\033[1mRunning frontend tests\033[0m" run "npm run test"