From 8e7dcea04083b0e10c60a40548e465e750519474 Mon Sep 17 00:00:00 2001 From: Tomas D'Stefano Date: Tue, 24 Dec 2024 14:58:11 +0000 Subject: [PATCH] Add more debugging --- .github/workflows/build-and-deploy.yml | 41 ++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 04ecee476b..58db9402e0 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -240,11 +240,42 @@ jobs: docker compose up --no-build -d docker compose exec -T web /bin/sh -c "./wait-for-command.sh -c 'nc -z db 5432' -s 0 -t 20" docker compose exec -T web /bin/sh -c 'bundle config --local disable_exec_load true' - docker compose exec -T web /bin/sh -c 'apk add --no-cache xvfb xauth nss' - # docker compose exec -T web /bin/sh -c "echo 'Checking if chromedriver is installed...'; which chromium; which chromedriver; ls -l /usr/bin/chromium; ls -l /usr/bin/chromedriver; chromium --version; chromedriver --version" - # Ensure that xvfb is set up to allow GUI-based apps like Chromium to run headlessly - docker compose exec -T web /bin/sh -c 'Xvfb :99 -ac &' - docker compose exec -T web /bin/sh -c 'export DISPLAY=:99' + + # Locate and verify Chrome and ChromeDriver + docker compose exec -T web /bin/sh -c " + echo '=== Checking Chrome and ChromeDriver Setup ===' + + # Locate Chrome directory dynamically + CHROME_DIR=\$(ls -d /root/.cache/selenium/chrome/linux64/* | head -n 1) + if [ -z \"\$CHROME_DIR\" ]; then + echo 'Error: Chrome directory not found in /root/.cache/selenium/chrome/linux64/' + exit 1 + fi + echo 'Chrome directory found: \$CHROME_DIR' + + # List files in Chrome directory + echo 'Listing files in Chrome directory:' + ls -l \$CHROME_DIR + + echo '=== Checking Chromedriver ===' + ls -l /root/.cache/selenium/chromedriver/linux64/ + ls -l /root/.cache/selenium/chromedriver/linux64/* + + # Check Chrome version and permissions + CHROME_BINARY=\$CHROME_DIR/chrome + if [ -f \"\$CHROME_BINARY\" ]; then + echo 'Chrome binary found: \$CHROME_BINARY' + chmod +x \$CHROME_BINARY + echo 'Chrome permissions:' + ls -l \$CHROME_BINARY + echo 'Chrome version:' + \$CHROME_BINARY --version || echo 'Error: Unable to execute Chrome binary' + else + echo 'Error: Chrome binary not found in \$CHROME_DIR' + fi + + echo '=== Chrome and Chromedriver Setup Check Completed ===' + " docker compose exec -T web /bin/sh -c 'bundle exec rake parallel:setup' - name: ${{ matrix.tests }} tests