From 62acabddceccd2d84331ee11493b18b9007445a4 Mon Sep 17 00:00:00 2001 From: aasim Date: Sat, 4 May 2024 12:48:36 -0400 Subject: [PATCH 1/5] changed to run without all the setup --- .github/workflows/pr_ci_playwright_e2e.yaml | 37 +++------------------ 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/.github/workflows/pr_ci_playwright_e2e.yaml b/.github/workflows/pr_ci_playwright_e2e.yaml index 84500b7b4..1c71c2626 100644 --- a/.github/workflows/pr_ci_playwright_e2e.yaml +++ b/.github/workflows/pr_ci_playwright_e2e.yaml @@ -8,16 +8,6 @@ jobs: runs-on: ubuntu-latest environment: dev - services: - postgres: - image: postgres:15 - env: - POSTGRES_DB: ${{ secrets.DATABASE_NAME }} - POSTGRES_USER: ${{ secrets.DATABASE_USER }} - POSTGRES_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} - ports: - - 5432:5432 - steps: - name: cleanup old checkout run: chmod +w -R ${GITHUB_WORKSPACE}; rm -rf ${GITHUB_WORKSPACE}/*; @@ -32,37 +22,18 @@ jobs: - name: Check Port Availability run: | - ! nc -z localhost ${{ secrets.FRONTEND_PORT }} && \ - ! nc -z localhost ${{ secrets.BACKEND_PORT }} && \ + ! nc -z localhost 3000 && \ + ! nc -z localhost 8000 && \ ! nc -z localhost 5432 - - name: Set up Docker Compose - run: | - echo "FRONTEND_PORT=${{ secrets.FRONTEND_PORT }}" >> .env - echo "BACKEND_PORT=${{ secrets.BACKEND_PORT }}" >> .env - echo "DATABASE_PORT=${{ secrets.DATABASE_PORT }}" >> .env - echo "DATABASE_HOST=postgres" >> .env # Using the service name from the services section - echo "DATABASE_NAME=${{ secrets.DATABASE_NAME }}" >> .env - echo "DATABASE_USER=${{ secrets.DATABASE_USER }}" >> .env - echo "DATABASE_PASSWORD=${{ secrets.DATABASE_PASSWORD }}" >> .env - echo "DJANGO_ALLOWED_HOSTS=${{ secrets.DJANGO_ALLOWED_HOSTS }}" >> .env - echo "DEBUG=${{ secrets.DEBUG }}" >> .env - echo "SECRET_KEY=${{ secrets.SECRET_KEY }}" >> .env - - name: Run Docker Compose - run: docker-compose -f docker-compose.yml up --build -d + run: docker compose --env-file .env.dev up --build -d - name: Setup Node environment uses: actions/setup-node@v4 with: node-version: 20 - #- name: Install dependencies via Yarn - #uses: borales/actions-yarn@v5 - #with: - #cmd: install --immutable --force --frozen-lockfile - #dir: "frontend" - - name: Install dependencies via Yarn working-directory: ./frontend run: | @@ -76,7 +47,7 @@ jobs: - name: Wait for web server to be ready working-directory: ./frontend run: | - curl --retry 15 --retry-delay 5 --retry-all-errors http://localhost:${{ secrets.FRONTEND_PORT }} + curl --retry 15 --retry-delay 5 --retry-all-errors http://localhost:3000 - name: Run Playwright tests working-directory: ./frontend From edb87a453594ec44c1512318bebbf5f1eb97bc3d Mon Sep 17 00:00:00 2001 From: aasim Date: Sat, 4 May 2024 13:14:18 -0400 Subject: [PATCH 2/5] moved 'wait for web server' immediately after docker compose; removed 'docker down' --- .github/workflows/pr_ci_playwright_e2e.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pr_ci_playwright_e2e.yaml b/.github/workflows/pr_ci_playwright_e2e.yaml index 1c71c2626..e191b31c2 100644 --- a/.github/workflows/pr_ci_playwright_e2e.yaml +++ b/.github/workflows/pr_ci_playwright_e2e.yaml @@ -29,6 +29,11 @@ jobs: - name: Run Docker Compose run: docker compose --env-file .env.dev up --build -d + - name: Wait for web server to be ready + working-directory: ./frontend + run: | + curl --retry 20 --retry-delay 5 --retry-all-errors http://localhost:3000 + - name: Setup Node environment uses: actions/setup-node@v4 with: @@ -44,11 +49,6 @@ jobs: run: | sudo yarn playwright install --with-deps - - name: Wait for web server to be ready - working-directory: ./frontend - run: | - curl --retry 15 --retry-delay 5 --retry-all-errors http://localhost:3000 - - name: Run Playwright tests working-directory: ./frontend run: | @@ -61,7 +61,3 @@ jobs: name: playwright-report path: frontend/playwright-report/ retention-days: 30 - - - name: Shutdown Docker Compose - if: always() - run: docker-compose down From 8db240e6455e9b18a4e6946e122ce8fe3d3a98a7 Mon Sep 17 00:00:00 2001 From: aasim Date: Sat, 4 May 2024 13:21:25 -0400 Subject: [PATCH 3/5] moved the 'wait for web server' back to just before run playwright tests --- .github/workflows/pr_ci_playwright_e2e.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_ci_playwright_e2e.yaml b/.github/workflows/pr_ci_playwright_e2e.yaml index e191b31c2..200834bc1 100644 --- a/.github/workflows/pr_ci_playwright_e2e.yaml +++ b/.github/workflows/pr_ci_playwright_e2e.yaml @@ -29,11 +29,6 @@ jobs: - name: Run Docker Compose run: docker compose --env-file .env.dev up --build -d - - name: Wait for web server to be ready - working-directory: ./frontend - run: | - curl --retry 20 --retry-delay 5 --retry-all-errors http://localhost:3000 - - name: Setup Node environment uses: actions/setup-node@v4 with: @@ -49,6 +44,11 @@ jobs: run: | sudo yarn playwright install --with-deps + - name: Wait for web server to be ready + working-directory: ./frontend + run: | + curl --retry 20 --retry-delay 5 --retry-all-errors http://localhost:3000 + - name: Run Playwright tests working-directory: ./frontend run: | From 7cb09fc0fd7e495ef5424b920341442f1809f7ab Mon Sep 17 00:00:00 2001 From: aasim Date: Sat, 4 May 2024 14:01:03 -0400 Subject: [PATCH 4/5] added yarn cache v1.22.22 success Cleared cache. Done in 0.02s.; changed server avail check to use ; added peer dependency '@opentelemetry/api@>=1.0.0 <1.9.0' --- .github/workflows/pr_ci_playwright_e2e.yaml | 8 +- frontend/package.json | 2 + frontend/yarn.lock | 95 +++++++++++++++++++-- 3 files changed, 97 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr_ci_playwright_e2e.yaml b/.github/workflows/pr_ci_playwright_e2e.yaml index 200834bc1..b9debda6c 100644 --- a/.github/workflows/pr_ci_playwright_e2e.yaml +++ b/.github/workflows/pr_ci_playwright_e2e.yaml @@ -34,6 +34,11 @@ jobs: with: node-version: 20 + - name: Clean Yarn cache + working-directory: ./frontend + run: | + sudo yarn cache clean + - name: Install dependencies via Yarn working-directory: ./frontend run: | @@ -45,9 +50,8 @@ jobs: sudo yarn playwright install --with-deps - name: Wait for web server to be ready - working-directory: ./frontend run: | - curl --retry 20 --retry-delay 5 --retry-all-errors http://localhost:3000 + yarn wait-on http://localhost:3000 - name: Run Playwright tests working-directory: ./frontend diff --git a/frontend/package.json b/frontend/package.json index 8f576754b..8c8f468ea 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -47,6 +47,7 @@ "@maplibre/maplibre-gl-directions": "^0.7.0", "@nuxtjs/axios": "^5.13.6", "@nuxtjs/plausible": "^1.0.0", + "@opentelemetry/api": ">=1.0.0 <1.9.0", "@popperjs/core": "^2.11.8", "@somushq/vue3-friendly-captcha": "^1.0.2", "@types/geojson": "^7946.0.14", @@ -71,6 +72,7 @@ "v-calendar": "^3.1.1", "vue-socials": "^2.0.5", "vuedraggable": "~4.1.0", + "wait-on": "^7.2.0", "zxcvbn": "^4.4.2" } } diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 9bfaa1ade..ab43c55b9 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -616,6 +616,18 @@ resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.2.tgz#d8bae93ac8b815b2bd7a98078cf91e2724ef11e5" integrity sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw== +"@hapi/hoek@^9.0.0", "@hapi/hoek@^9.3.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" + integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== + +"@hapi/topo@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" + integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== + dependencies: + "@hapi/hoek" "^9.0.0" + "@headlessui/vue@^1.7.19": version "1.7.21" resolved "https://registry.yarnpkg.com/@headlessui/vue/-/vue-1.7.21.tgz#debad090e6ae191f50cadde54d0b53322983ac6c" @@ -1457,7 +1469,7 @@ dependencies: "@opentelemetry/api" "^1.0.0" -"@opentelemetry/api@^1.0.0": +"@opentelemetry/api@>=1.0.0 <1.9.0", "@opentelemetry/api@^1.0.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.8.0.tgz#5aa7abb48f23f693068ed2999ae627d2f7d902ec" integrity sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w== @@ -1870,6 +1882,23 @@ dependencies: shiki "1.4.0" +"@sideway/address@^4.1.5": + version "4.1.5" + resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.5.tgz#4bc149a0076623ced99ca8208ba780d65a99b9d5" + integrity sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q== + dependencies: + "@hapi/hoek" "^9.0.0" + +"@sideway/formula@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.1.tgz#80fcbcbaf7ce031e0ef2dd29b1bfc7c3f583611f" + integrity sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg== + +"@sideway/pinpoint@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" + integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== + "@sigstore/bundle@^2.3.0", "@sigstore/bundle@^2.3.1": version "2.3.1" resolved "https://registry.yarnpkg.com/@sigstore/bundle/-/bundle-2.3.1.tgz#f6cdc67c8400e58ca27f0ef495b27a9327512073" @@ -3158,7 +3187,7 @@ axios@^0.21.1: dependencies: follow-redirects "^1.14.0" -axios@^1.6.8: +axios@^1.6.1, axios@^1.6.8: version "1.6.8" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== @@ -5874,6 +5903,17 @@ jiti@^1.21.0: resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.0.tgz#7c97f8fe045724e136a397f7340475244156105d" integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q== +joi@^17.11.0: + version "17.13.1" + resolved "https://registry.yarnpkg.com/joi/-/joi-17.13.1.tgz#9c7b53dc3b44dd9ae200255cc3b398874918a6ca" + integrity sha512-vaBlIKCyo4FCUtCm7Eu4QZd/q02bWcxfUO6YSXAZOWF6gzcLBeba8kwotUdYJjDLW8Cz8RywsSOqiNJZW0mNvg== + dependencies: + "@hapi/hoek" "^9.3.0" + "@hapi/topo" "^5.1.0" + "@sideway/address" "^4.1.5" + "@sideway/formula" "^3.0.1" + "@sideway/pinpoint" "^2.0.0" + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -8658,6 +8698,13 @@ rw@^1.3.3: resolved "https://registry.yarnpkg.com/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4" integrity sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ== +rxjs@^7.8.1: + version "7.8.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" + integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== + dependencies: + tslib "^2.1.0" + safe-buffer@5.2.1, safe-buffer@^5.1.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -9086,7 +9133,16 @@ strict-event-emitter@^0.5.1: resolved "https://registry.yarnpkg.com/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz#1602ece81c51574ca39c6815e09f1a3e8550bd93" integrity sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ== -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -9126,7 +9182,14 @@ stringify-entities@^4.0.3: character-entities-html4 "^2.0.0" character-entities-legacy "^3.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -9430,7 +9493,7 @@ ts-interface-checker@^0.1.9: resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== -tslib@^2.6.2: +tslib@^2.1.0, tslib@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== @@ -10142,6 +10205,17 @@ vuedraggable@~4.1.0: dependencies: sortablejs "1.14.0" +wait-on@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/wait-on/-/wait-on-7.2.0.tgz#d76b20ed3fc1e2bebc051fae5c1ff93be7892928" + integrity sha512-wCQcHkRazgjG5XoAq9jbTMLpNIjoSlZslrJ2+N9MxDsGEv1HnFoVjOCexL0ESva7Y9cu350j+DWADdk54s4AFQ== + dependencies: + axios "^1.6.1" + joi "^17.11.0" + lodash "^4.17.21" + minimist "^1.2.8" + rxjs "^7.8.1" + web-namespaces@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-2.0.1.tgz#1010ff7c650eccb2592cebeeaf9a1b253fd40692" @@ -10220,7 +10294,7 @@ word-wrap@^1.2.5: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -10238,6 +10312,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From c23ea486f38238183a930e76db61b89981ee7b6a Mon Sep 17 00:00:00 2001 From: aasim Date: Sat, 4 May 2024 14:05:55 -0400 Subject: [PATCH 5/5] added working directory to fix wait-on error --- .github/workflows/pr_ci_playwright_e2e.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr_ci_playwright_e2e.yaml b/.github/workflows/pr_ci_playwright_e2e.yaml index b9debda6c..a720e280a 100644 --- a/.github/workflows/pr_ci_playwright_e2e.yaml +++ b/.github/workflows/pr_ci_playwright_e2e.yaml @@ -50,6 +50,7 @@ jobs: sudo yarn playwright install --with-deps - name: Wait for web server to be ready + working-directory: ./frontend run: | yarn wait-on http://localhost:3000