Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable functional javascript tests #1013

Closed
wants to merge 16 commits into from
33 changes: 21 additions & 12 deletions .github/workflows/build-2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,30 @@ on:
jobs:
# This workflow contains a single job called "build"
build:
env:
SIMPLETEST_BASE_URL: http://host.docker.internal:8282
DRUPAL_VERSION: ${{ matrix.drupal-version }}
SCRIPT_DIR: ${{ github.workspace }}/islandora_ci
DRUPAL_DIR: /opt/drupal
PHPUNIT_FILE: ${{ github.workspace }}/build_dir/phpunit.xml
MINK_DRIVER_ARGS_WEBDRIVER: '["firefox", null, "http://127.0.0.1:4444/wd/hub"]'

# The type of runner that the job will run on
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allowed_failure }}
strategy:
fail-fast: false
matrix:
php-versions: ["8.1", "8.2", "8.3"]
# test-suite functional-javascript will appear to pass but will skip tests; missing chromedriver.
test-suite: ["kernel", "functional", "functional-javascript"]
# test-suite: ["kernel", "functional", "functional-javascript"]
test-suite: ["functional-javascript"]
drupal-version: ["10.1.x", "10.2.x", "10.3.x-dev"]
mysql: ["8.0"]
allowed_failure: [false]
exclude:
- php-versions: "8.3"
drupal-version: "10.1.x"


name: PHP ${{ matrix.php-versions }} | drupal ${{ matrix.drupal-version }} | mysql ${{ matrix.mysql }} | test-suite ${{ matrix.test-suite }}

services:
Expand All @@ -50,18 +57,23 @@ jobs:
- 8161:8161
- 61616:61616
- 61613:61613
firefox:
image: selenium/standalone-firefox:3.141
ports:
- 4444:4444
options: --add-host=host.docker.internal:host-gateway

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: build_dir

- name: Checkout islandora_ci
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: islandora/islandora_ci
ref: github-actions
Expand All @@ -79,13 +91,6 @@ jobs:
sudo apt-get remove -y mysql-client mysql-common
sudo apt-get install -y mysql-client

- name: Set environment variables
run: |
echo "DRUPAL_VERSION=${{ matrix.drupal-version }}" >> $GITHUB_ENV
echo "SCRIPT_DIR=$GITHUB_WORKSPACE/islandora_ci" >> $GITHUB_ENV
echo "DRUPAL_DIR=/opt/drupal" >> $GITHUB_ENV
echo "PHPUNIT_FILE=$GITHUB_WORKSPACE/build_dir/phpunit.xml" >> $GITHUB_ENV

- name: Cache Composer dependencies
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -123,3 +128,7 @@ jobs:
run: |
cd $DRUPAL_DIR/web/core
$DRUPAL_DIR/vendor/bin/phpunit --verbose --testsuite "${{ matrix.test-suite }}"
if [ "${{ matrix.test-suite }}" = "functional-javascript" ]; then
echo "Printing selenium logs"
docker logs $(docker container ls --format "{{.Names}}" | grep firefox)
fi
Loading