From 26211c6073fc110686501c086003eb677f488d2d Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 13:01:05 +0200 Subject: [PATCH 01/34] feat: Run datatracker test suite for PRs --- .github/workflows/ci-run-tests.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/ci-run-tests.yml diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml new file mode 100644 index 00000000000..f69ecf923e6 --- /dev/null +++ b/.github/workflows/ci-run-tests.yml @@ -0,0 +1,20 @@ +name: Run all tests + +on: + push: +# branches: [ main ] +# pull_request: +# branches: [ main ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build . --file docker/app.Dockerfile --tag dt-tests:$(date +%s) + - name: Prepare the Docker container + run: docker run dt-tests:$(date +%s) From 0cd1d555d10532f91717fef200a14da103c6ade7 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 14:29:47 +0200 Subject: [PATCH 02/34] Fixes --- .github/workflows/ci-run-tests.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index f69ecf923e6..8ef23041f59 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -15,6 +15,30 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build the Docker image - run: docker build . --file docker/app.Dockerfile --tag dt-tests:$(date +%s) - - name: Prepare the Docker container - run: docker run dt-tests:$(date +%s) + run: > + docker build . + --file docker/app.Dockerfile + --build-arg VARIANT=3.6-bullseye + --build-arg NODE_VERSION=16 + --tag dt-tests:ephemeral + - name: Run all the tests + run: | + docker-compose + --file docker-compose.yml + --file docker/docker-compose.extend.yml + up --detach + docker-compose exec app + /docker-init.sh /workspace/ietf/manage.py test + --settings=settings_local_sqlitetest + --failfast + docker-compose stop + + + # docker run + # --tty --interactive + # --volume $(pwd):/workspace + # dt-tests:ephemeral + # /docker-init.sh + # /workspace/ietf/manage.py test + # --settings=settings_local_sqlitetest + # --failfast From 26fbaeb44b7052193307cc35d754b5de9dc86ca6 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 14:30:43 +0200 Subject: [PATCH 03/34] Fixes --- .github/workflows/ci-run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 8ef23041f59..089a9d663dd 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build the Docker image - run: > + run: | docker build . --file docker/app.Dockerfile --build-arg VARIANT=3.6-bullseye From c2ba776f1326848d25af5c92f52e2d40675d9610 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 14:39:34 +0200 Subject: [PATCH 04/34] No need to build with compose --- .github/workflows/ci-run-tests.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 089a9d663dd..e6b4d324ddf 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -14,13 +14,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Build the Docker image - run: | - docker build . - --file docker/app.Dockerfile - --build-arg VARIANT=3.6-bullseye - --build-arg NODE_VERSION=16 - --tag dt-tests:ephemeral - name: Run all the tests run: | docker-compose From 591c64bffc7ae3951f1a5a9ababf446107e32764 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 14:43:04 +0200 Subject: [PATCH 05/34] Fixes --- .github/workflows/ci-run-tests.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index e6b4d324ddf..64944b258ea 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -7,31 +7,20 @@ on: # branches: [ main ] jobs: - build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - name: Run all the tests - run: | + - run: > docker-compose --file docker-compose.yml --file docker/docker-compose.extend.yml up --detach + - run: > docker-compose exec app /docker-init.sh /workspace/ietf/manage.py test --settings=settings_local_sqlitetest --failfast + - run: > docker-compose stop - - - # docker run - # --tty --interactive - # --volume $(pwd):/workspace - # dt-tests:ephemeral - # /docker-init.sh - # /workspace/ietf/manage.py test - # --settings=settings_local_sqlitetest - # --failfast From 69fb344029c11dc6a9725f956ea274cfe497be4b Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 14:44:57 +0200 Subject: [PATCH 06/34] Fix syntax --- .github/workflows/ci-run-tests.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 64944b258ea..db4b9d2859e 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -11,16 +11,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Run all the tests - - run: > + - name: Start docker + run: > docker-compose --file docker-compose.yml --file docker/docker-compose.extend.yml up --detach - - run: > + - name: Run all tests + run: > docker-compose exec app /docker-init.sh /workspace/ietf/manage.py test --settings=settings_local_sqlitetest --failfast - - run: > + - name: Stop docker + run: > docker-compose stop From 565f21f86c28cf839a8c7d39c67691a33e9861af Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 14:49:34 +0200 Subject: [PATCH 07/34] Fix syntax --- .github/workflows/ci-run-tests.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index db4b9d2859e..d8dd80b1db4 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -12,17 +12,16 @@ jobs: steps: - uses: actions/checkout@v2 - name: Start docker - run: > - docker-compose - --file docker-compose.yml - --file docker/docker-compose.extend.yml + run: | + docker-compose \ + --file docker-compose.yml \ + --file docker/docker-compose.extend.yml \ up --detach - name: Run all tests - run: > - docker-compose exec app - /docker-init.sh /workspace/ietf/manage.py test - --settings=settings_local_sqlitetest + run: | + docker-compose exec app \ + /docker-init.sh /workspace/ietf/manage.py test \ + --settings=settings_local_sqlitetest \ --failfast - name: Stop docker - run: > - docker-compose stop + run: docker-compose stop From 4039ed1c59bcbfb4b2d626648c8071b76590f3e3 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 15:01:40 +0200 Subject: [PATCH 08/34] -T --- .github/workflows/ci-run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index d8dd80b1db4..a380f5bea09 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -19,7 +19,7 @@ jobs: up --detach - name: Run all tests run: | - docker-compose exec app \ + docker-compose exec -T app \ /docker-init.sh /workspace/ietf/manage.py test \ --settings=settings_local_sqlitetest \ --failfast From 97b4751d9ec179d127f651373f4bd142683e1d61 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 15:56:38 +0200 Subject: [PATCH 09/34] Pass the error code upwards --- docker/scripts/app-init.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/scripts/app-init.sh b/docker/scripts/app-init.sh index adfc7c132e4..9f59c3a2edf 100755 --- a/docker/scripts/app-init.sh +++ b/docker/scripts/app-init.sh @@ -98,6 +98,7 @@ echo "Running initial checks..." echo "Done!" if [ -z "$EDITOR_VSCODE" ]; then + CODE=0 python -m smtpd -n -c DebuggingServer localhost:2025 & if [ -z "$*" ]; then echo @@ -112,6 +113,8 @@ if [ -z "$EDITOR_VSCODE" ]; then echo "Executing \"$*\" and stopping container." echo bash -c "$*" + CODE=$? fi service rsyslog stop + exit $CODE fi \ No newline at end of file From 5f5a60faa3e0504e6f9771a53af04da48e7baf70 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 16:13:16 +0200 Subject: [PATCH 10/34] Also run on PRs --- .github/workflows/ci-run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index a380f5bea09..42ca7194af9 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -3,7 +3,7 @@ name: Run all tests on: push: # branches: [ main ] -# pull_request: + pull_request: # branches: [ main ] jobs: From 2ec3e5320e4c6f006d63c6fee9dd88909d16c9ad Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 16 Mar 2022 18:16:22 +0200 Subject: [PATCH 11/34] Don't trigger on push --- .github/workflows/ci-run-tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 42ca7194af9..328590f7fc4 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -1,10 +1,7 @@ name: Run all tests on: - push: -# branches: [ main ] pull_request: -# branches: [ main ] jobs: build: From 9f399cc92756f3d7c0652a56b0306c990b905780 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Wed, 16 Mar 2022 21:57:31 -0400 Subject: [PATCH 12/34] ci: use base test docker image + use actions services --- .github/workflows/ci-run-tests.yml | 50 +++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 328590f7fc4..76721e4e9d9 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -1,24 +1,46 @@ -name: Run all tests +name: Run All Tests on: pull_request: jobs: - build: + tests: + name: Run Tests runs-on: ubuntu-latest + container: ghcr.io/ietf-tools/datatracker-test-base:latest + + services: + db: + image: ghcr.io/ietf-tools/datatracker-db:latest + volumes: + - mariadb-data:/var/lib/mysql + env: + MYSQL_ROOT_PASSWORD: ietf + MYSQL_DATABASE: ietf_utf8 + MYSQL_USER: django + MYSQL_PASSWORD: RkTkDPFnKpko + ports: + - 3306:3306 + options: >- + --character-set-server=utf8 + --collation-server=utf8_unicode_ci + --innodb-buffer-pool-size=1G + --innodb-log-buffer-size=128M + --innodb-log-file-size=256M + --innodb-write-io-threads=8 + --innodb-flush-log-at-trx-commit=0 + --performance-schema=1 + steps: - - uses: actions/checkout@v2 - - name: Start docker + - uses: actions/checkout@v3 + with: + path: /workspace + - name: Wait for DB to come online run: | - docker-compose \ - --file docker-compose.yml \ - --file docker/docker-compose.extend.yml \ - up --detach + /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" - name: Run all tests + working-directory: /workspace run: | - docker-compose exec -T app \ - /docker-init.sh /workspace/ietf/manage.py test \ - --settings=settings_local_sqlitetest \ - --failfast - - name: Stop docker - run: docker-compose stop + ./ietf/manage.py test \ + --settings=settings_local_sqlitetest \ + --failfast From bdc9477e7fc4cd63454eb24c9f3a0a13fee82f40 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Wed, 16 Mar 2022 22:26:31 -0400 Subject: [PATCH 13/34] ci: disable mariadb service during tests --- .github/workflows/ci-run-tests.yml | 48 +++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 76721e4e9d9..733398a3739 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -9,35 +9,35 @@ jobs: runs-on: ubuntu-latest container: ghcr.io/ietf-tools/datatracker-test-base:latest - services: - db: - image: ghcr.io/ietf-tools/datatracker-db:latest - volumes: - - mariadb-data:/var/lib/mysql - env: - MYSQL_ROOT_PASSWORD: ietf - MYSQL_DATABASE: ietf_utf8 - MYSQL_USER: django - MYSQL_PASSWORD: RkTkDPFnKpko - ports: - - 3306:3306 - options: >- - --character-set-server=utf8 - --collation-server=utf8_unicode_ci - --innodb-buffer-pool-size=1G - --innodb-log-buffer-size=128M - --innodb-log-file-size=256M - --innodb-write-io-threads=8 - --innodb-flush-log-at-trx-commit=0 - --performance-schema=1 +# services: +# db: +# image: ghcr.io/ietf-tools/datatracker-db:latest +# volumes: +# - mariadb-data:/var/lib/mysql +# env: +# MYSQL_ROOT_PASSWORD: ietf +# MYSQL_DATABASE: ietf_utf8 +# MYSQL_USER: django +# MYSQL_PASSWORD: RkTkDPFnKpko +# ports: +# - 3306:3306 +# options: >- +# --character-set-server=utf8 +# --collation-server=utf8_unicode_ci +# --innodb-buffer-pool-size=1G +# --innodb-log-buffer-size=128M +# --innodb-log-file-size=256M +# --innodb-write-io-threads=8 +# --innodb-flush-log-at-trx-commit=0 +# --performance-schema=1 steps: - uses: actions/checkout@v3 with: path: /workspace - - name: Wait for DB to come online - run: | - /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" +# - name: Wait for DB to come online +# run: | +# /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" - name: Run all tests working-directory: /workspace run: | From 4f8261b4daadc7f73541ea969a956e91683a3b84 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Wed, 16 Mar 2022 22:29:34 -0400 Subject: [PATCH 14/34] ci: use default checkout path for tests --- .github/workflows/ci-run-tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 733398a3739..4b592f6f51c 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -33,13 +33,10 @@ jobs: steps: - uses: actions/checkout@v3 - with: - path: /workspace # - name: Wait for DB to come online # run: | # /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" - name: Run all tests - working-directory: /workspace run: | ./ietf/manage.py test \ --settings=settings_local_sqlitetest \ From 1b69cfdef870206d114aacc9dfa1ec57f2ee2b9a Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Wed, 16 Mar 2022 22:44:36 -0400 Subject: [PATCH 15/34] ci: add prepare steps to tests workflow --- .github/workflows/ci-run-tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 4b592f6f51c..22b97eebac7 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -36,6 +36,13 @@ jobs: # - name: Wait for DB to come online # run: | # /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" + - name: Prepare for tests + run: | + cp ./docker/configs/settings_local_sqlitetest.py ./ietf/settings_local_sqlitetest.py + npm install --prefer-offline --no-audit + npx parcel build + ./ietf/manage.py check --settings=settings_local_sqlitetest + - name: Run all tests run: | ./ietf/manage.py test \ From 570cd684bd7f6245fd63ade6bf94fe20f925dfac Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Wed, 16 Mar 2022 22:58:58 -0400 Subject: [PATCH 16/34] ci: try test build with sudo --- .github/workflows/ci-run-tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 22b97eebac7..8f4bb03e228 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -38,9 +38,12 @@ jobs: # /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" - name: Prepare for tests run: | + whoami + pwd + ls -la cp ./docker/configs/settings_local_sqlitetest.py ./ietf/settings_local_sqlitetest.py npm install --prefer-offline --no-audit - npx parcel build + sudo npx parcel build ./ietf/manage.py check --settings=settings_local_sqlitetest - name: Run all tests From 30797ba1b90c68c6060c68eed6751c68afac8bc9 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Wed, 16 Mar 2022 23:07:50 -0400 Subject: [PATCH 17/34] ci: test workflow - attempt creating dist dirs beforehand --- .github/workflows/ci-run-tests.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 8f4bb03e228..e0ba9e506dd 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -38,12 +38,11 @@ jobs: # /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" - name: Prepare for tests run: | - whoami - pwd - ls -la + mkdir -p ietf/static/dist/ietf + mkdir -p ietf/secr/static/dist/secr cp ./docker/configs/settings_local_sqlitetest.py ./ietf/settings_local_sqlitetest.py npm install --prefer-offline --no-audit - sudo npx parcel build + npx parcel build ./ietf/manage.py check --settings=settings_local_sqlitetest - name: Run all tests From ea6485a833360376be1661b9a8f6b73322d4e00e Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Wed, 16 Mar 2022 23:17:23 -0400 Subject: [PATCH 18/34] ci: tests workflow - try chmod workspace --- .github/workflows/ci-run-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index e0ba9e506dd..71699250cd9 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -38,8 +38,8 @@ jobs: # /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" - name: Prepare for tests run: | - mkdir -p ietf/static/dist/ietf - mkdir -p ietf/secr/static/dist/secr + ls -la ietf/static + chmod -R 777 ./ cp ./docker/configs/settings_local_sqlitetest.py ./ietf/settings_local_sqlitetest.py npm install --prefer-offline --no-audit npx parcel build From 720e0761c665bf4eaad18782eb3f17512a1ac460 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Wed, 16 Mar 2022 23:22:27 -0400 Subject: [PATCH 19/34] ci: tests workflow - copy settings_local config --- .github/workflows/ci-run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 71699250cd9..0d9e2c7cb13 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -38,8 +38,8 @@ jobs: # /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" - name: Prepare for tests run: | - ls -la ietf/static chmod -R 777 ./ + cp ./docker/configs/settings_local.py ./ietf/settings_local.py cp ./docker/configs/settings_local_sqlitetest.py ./ietf/settings_local_sqlitetest.py npm install --prefer-offline --no-audit npx parcel build From b409991be3e01c63a1488fe4f5937a8336ede888 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Wed, 16 Mar 2022 23:35:08 -0400 Subject: [PATCH 20/34] ci: tests workflow - remove django check --- .github/workflows/ci-run-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 0d9e2c7cb13..eafd49477ef 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -43,7 +43,6 @@ jobs: cp ./docker/configs/settings_local_sqlitetest.py ./ietf/settings_local_sqlitetest.py npm install --prefer-offline --no-audit npx parcel build - ./ietf/manage.py check --settings=settings_local_sqlitetest - name: Run all tests run: | From 2f47ea7dd0fc618cec7d6f9e8d8397d6efc37a9f Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Thu, 17 Mar 2022 00:19:58 -0400 Subject: [PATCH 21/34] ci: tests workflow - call app-create-dirs.sh --- .github/workflows/ci-run-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index eafd49477ef..d69e1aeedb3 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -43,6 +43,8 @@ jobs: cp ./docker/configs/settings_local_sqlitetest.py ./ietf/settings_local_sqlitetest.py npm install --prefer-offline --no-audit npx parcel build + chmod +x ./docker/scripts/app-create-dirs.sh + ./docker/scripts/app-create-dirs.sh - name: Run all tests run: | From 86326415fb3f9604a3d486cc555a928784be2099 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Thu, 17 Mar 2022 00:29:42 -0400 Subject: [PATCH 22/34] ci: tests workflow - do migrate before tests --- .github/workflows/ci-run-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index d69e1aeedb3..b0cddd6684f 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -48,6 +48,7 @@ jobs: - name: Run all tests run: | + ./ietf/manage.py migrate --settings=settings_local_sqlitetest ./ietf/manage.py test \ --settings=settings_local_sqlitetest \ --failfast From f80406c77cdb02684b76918e085736e0682e377d Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Thu, 17 Mar 2022 13:28:43 -0400 Subject: [PATCH 23/34] ci: tests workflow - use settings_sqlitetest config --- .github/workflows/ci-run-tests.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index b0cddd6684f..3abe0edd6a6 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -38,17 +38,20 @@ jobs: # /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" - name: Prepare for tests run: | + echo "Fixing permissions..." chmod -R 777 ./ + echo "Copying docker config files..." cp ./docker/configs/settings_local.py ./ietf/settings_local.py cp ./docker/configs/settings_local_sqlitetest.py ./ietf/settings_local_sqlitetest.py + echo "Installing NPM packages..." npm install --prefer-offline --no-audit + echo "Building static assets..." npx parcel build + echo "Creating data directories..." chmod +x ./docker/scripts/app-create-dirs.sh ./docker/scripts/app-create-dirs.sh - name: Run all tests run: | - ./ietf/manage.py migrate --settings=settings_local_sqlitetest - ./ietf/manage.py test \ - --settings=settings_local_sqlitetest \ - --failfast + ./ietf/manage.py check --settings=settings_sqlitetest + ./ietf/manage.py test --settings=settings_local_sqlitetest --failfast From 82da6471bbc3cdea227188bc88d95e9e9057ffd9 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Thu, 17 Mar 2022 13:36:41 -0400 Subject: [PATCH 24/34] ci: tests workflow - add some verbose --- .github/workflows/ci-run-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 3abe0edd6a6..e3ce7d1b8f3 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -53,5 +53,7 @@ jobs: - name: Run all tests run: | + echo "Running checks..." ./ietf/manage.py check --settings=settings_sqlitetest - ./ietf/manage.py test --settings=settings_local_sqlitetest --failfast + echo "Running tests..." + ./ietf/manage.py test --settings=settings_sqlitetest --failfast From 5efc7ed1bdd537fe67e13d2c0e1de837d84a7a52 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Thu, 17 Mar 2022 13:47:56 -0400 Subject: [PATCH 25/34] ci: tests workflow - remove checks --- .github/workflows/ci-run-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index e3ce7d1b8f3..0cac7cce9f7 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -53,7 +53,5 @@ jobs: - name: Run all tests run: | - echo "Running checks..." - ./ietf/manage.py check --settings=settings_sqlitetest echo "Running tests..." ./ietf/manage.py test --settings=settings_sqlitetest --failfast From b580308d88fcf18033daad161e5a36fc9edfe610 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Thu, 17 Mar 2022 15:50:46 -0400 Subject: [PATCH 26/34] ci: tests workflow - enable mariadb service container --- .github/workflows/ci-run-tests.yml | 45 +++++++++++++----------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 0cac7cce9f7..4760be9a8d9 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -9,33 +9,22 @@ jobs: runs-on: ubuntu-latest container: ghcr.io/ietf-tools/datatracker-test-base:latest -# services: -# db: -# image: ghcr.io/ietf-tools/datatracker-db:latest -# volumes: -# - mariadb-data:/var/lib/mysql -# env: -# MYSQL_ROOT_PASSWORD: ietf -# MYSQL_DATABASE: ietf_utf8 -# MYSQL_USER: django -# MYSQL_PASSWORD: RkTkDPFnKpko -# ports: -# - 3306:3306 -# options: >- -# --character-set-server=utf8 -# --collation-server=utf8_unicode_ci -# --innodb-buffer-pool-size=1G -# --innodb-log-buffer-size=128M -# --innodb-log-file-size=256M -# --innodb-write-io-threads=8 -# --innodb-flush-log-at-trx-commit=0 -# --performance-schema=1 + services: + db: + image: ghcr.io/ietf-tools/datatracker-db:latest + volumes: + - mariadb-data:/var/lib/mysql + env: + MYSQL_ROOT_PASSWORD: ietf + MYSQL_DATABASE: ietf_utf8 + MYSQL_USER: django + MYSQL_PASSWORD: RkTkDPFnKpko + ports: + - 3306:3306 steps: - uses: actions/checkout@v3 -# - name: Wait for DB to come online -# run: | -# /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" + - name: Prepare for tests run: | echo "Fixing permissions..." @@ -51,7 +40,13 @@ jobs: chmod +x ./docker/scripts/app-create-dirs.sh ./docker/scripts/app-create-dirs.sh + - name: Wait for DB to come online + run: | + /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" + - name: Run all tests run: | + echo "Running checks..." + ./ietf/manage.py check --settings=settings_local echo "Running tests..." - ./ietf/manage.py test --settings=settings_sqlitetest --failfast + ./ietf/manage.py test --settings=settings_local_sqlitetest --failfast From c8b6b9ba7d00034e4f36f384a6d223a5aca44c00 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Thu, 17 Mar 2022 15:58:24 -0400 Subject: [PATCH 27/34] ci: tests workflow - disable wait-for script --- .github/workflows/ci-run-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 4760be9a8d9..033506414ae 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -40,9 +40,9 @@ jobs: chmod +x ./docker/scripts/app-create-dirs.sh ./docker/scripts/app-create-dirs.sh - - name: Wait for DB to come online - run: | - /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" +# - name: Wait for DB to come online +# run: | +# /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" - name: Run all tests run: | From 1662ff90cc7c00d2ad1daba78db0f6d5fcb696dc Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Thu, 17 Mar 2022 16:22:31 -0400 Subject: [PATCH 28/34] ci: tests workflow - remove db port mapping --- .github/workflows/ci-run-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 033506414ae..6ef7c5904c4 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -19,8 +19,6 @@ jobs: MYSQL_DATABASE: ietf_utf8 MYSQL_USER: django MYSQL_PASSWORD: RkTkDPFnKpko - ports: - - 3306:3306 steps: - uses: actions/checkout@v3 From 7141b67ad4f5c567313e1d5448d75fb6f1848ad7 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Sat, 19 Mar 2022 05:48:08 -0400 Subject: [PATCH 29/34] Update ci-run-tests.yml --- .github/workflows/ci-run-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 6ef7c5904c4..cc34bca8156 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -25,6 +25,7 @@ jobs: - name: Prepare for tests run: | + docker ps -a echo "Fixing permissions..." chmod -R 777 ./ echo "Copying docker config files..." From 9eb38fcb5d0fc5efac87a421d8293df580d1f1d2 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Sat, 19 Mar 2022 06:00:50 -0400 Subject: [PATCH 30/34] Update ci-run-tests.yml --- .github/workflows/ci-run-tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index cc34bca8156..a0360a13e03 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -25,6 +25,10 @@ jobs: - name: Prepare for tests run: | + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null + apt-get update + apt-get install docker-ce-cli -y docker ps -a echo "Fixing permissions..." chmod -R 777 ./ From 214bcb7521ccd2ee750ab28319c2da5a36bf4578 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Sat, 19 Mar 2022 06:08:20 -0400 Subject: [PATCH 31/34] Update ci-run-tests.yml --- .github/workflows/ci-run-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index a0360a13e03..9fcbdd926e9 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -25,8 +25,8 @@ jobs: - name: Prepare for tests run: | - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null + curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null apt-get update apt-get install docker-ce-cli -y docker ps -a From 09d069117fd6b9850564c514e94dfe617aa2b6aa Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Sat, 19 Mar 2022 06:38:07 -0400 Subject: [PATCH 32/34] Update ci-run-tests.yml --- .github/workflows/ci-run-tests.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 9fcbdd926e9..ed3402b8bc7 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -25,10 +25,7 @@ jobs: - name: Prepare for tests run: | - curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null - apt-get update - apt-get install docker-ce-cli -y + echo "Running containers:" docker ps -a echo "Fixing permissions..." chmod -R 777 ./ @@ -43,9 +40,9 @@ jobs: chmod +x ./docker/scripts/app-create-dirs.sh ./docker/scripts/app-create-dirs.sh -# - name: Wait for DB to come online -# run: | -# /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" + - name: Ensure DB is ready + run: | + /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" - name: Run all tests run: | From e7b1a018071d6b0ba2283fdd605290db72a0176e Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Sat, 19 Mar 2022 06:43:45 -0400 Subject: [PATCH 33/34] Update ci-run-tests.yml --- .github/workflows/ci-run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index ed3402b8bc7..461a1d4a2e3 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -42,7 +42,7 @@ jobs: - name: Ensure DB is ready run: | - /usr/local/bin/wait-for localhost:3306 -- echo "DB ready" + /usr/local/bin/wait-for db:3306 -- echo "DB ready" - name: Run all tests run: | From 1bd17df80ca7954a7bb02141d066f5e727887b57 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Sat, 19 Mar 2022 07:05:45 -0400 Subject: [PATCH 34/34] Update ci-run-tests.yml --- .github/workflows/ci-run-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 461a1d4a2e3..27e489ca168 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -2,6 +2,9 @@ name: Run All Tests on: pull_request: + branches: + # TEMPORARY: Replace with main once bs5 is merged + - 'feat/bs5' jobs: tests: