Skip to content

adds ssh debugger for selenium test #1578

adds ssh debugger for selenium test

adds ssh debugger for selenium test #1578

Workflow file for this run

name: Ruby on Rails CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
system_tests:
if: github.repository == 'AllYourBot/hostedgpt'
runs-on: large-runner
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}-system
cancel-in-progress: true
services:
postgres:
image: postgres:16.1
ports:
- "5432:5432"
env:
POSTGRES_DB: hostedgpt_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/hostedgpt_test"
DISPLAY: "=:99"
DEBUG: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
- name: Start chromedriver
run: |
set -x
mkdir -p tmp/screenshots
touch tmp/screenshots/chromedriver.log
chromedriver --url-base=/wd/hub | sudo tee -a tmp/screenshots/chromedriver.log &
bin/lib/wait-for-it.sh localhost:9515 -- echo "Chromedriver is up!"
curl -i -XPOST http://localhost:9515/wd/hub/session \
-H 'Content-Type: application/json' \
-d '{"desiredCapabilities":{"browserName":"chrome"}}'
# sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Set up database schema
run: bin/rails db:prepare
- name: Build CSS
run: bin/rails tailwindcss:build
- name: Run system tests
run: |
echo -e "###\n###\n###\n### NOTICE: If these tests fail because of Net::ReadTimeout then re-run the test suite. I can't figure out this sporadic failure.\n###\n###\n###"
sed -i 's/hoverOnlyWhenSupported: true/hoverOnlyWhenSupported: false/' config/tailwind.config.js
mkdir -p tmp/screenshots
touch tmp/screenshots/chromedriver.log
bin/rails test:system 2> tmp/screenshots/selenium.log
- name: Upload screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: System Test Screenshots
path: tmp/screenshots/
if-no-files-found: ignore