Skip to content

Run 2.x tests

Run 2.x tests #636

Workflow file for this run

name: Run 2.x tests
on:
schedule:
- cron: '0 8 * * *' # Run at 8AM UTC.
push:
branches:
- '2.x'
- '2.x-**'
jobs:
two-point-x-tests:
name: Run 2.x tests
runs-on: ubuntu-latest
strategy:
matrix:
dbms:
- pgsql
- mysql
- sqlite
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Build QGIS Test Harness Docker image
run: docker build -t qgis_test_harness docker/qgis_test_harness
- name: Start containers
run: docker-compose --file ./docker/docker-compose.${{ matrix.dbms }}.yml up -d
- name: Wait until www container is ready
run: until [ -f ./docker/www/www-container-fs-ready ]; do sleep 0.1; done
- name: Run QGIS tests
run: docker run --rm --name qgis --network=docker_default -v $(pwd)'/docker/qgis_tests:/tests_directory' qgis_test_harness:latest ./run_tests.sh
two-point-x-composer-install:
name: Test 2.x installation via composer
runs-on: ubuntu-latest
steps:
- name: Get a docker-compose.yml file approximating a production site
run: curl https://raw.githubusercontent.com/symbioquine/farmOS_wfs/2.x/docker/docker-compose.prod-demo.yml -o docker-compose.yml
- name: Start containers
run: docker-compose up -d
- name: Wait until www container is ready
run: until [ -f ./www/www-container-fs-ready ]; do sleep 0.1; done && while { ! exec 3<>/dev/tcp/localhost/5432; } > /dev/null 2>&1; do sleep 0.1; done
- name: Fix keys directory permissions
run: docker-compose exec -T www bash -c 'mkdir -p /opt/drupal/keys && chown -R www-data:www-data /opt/drupal/keys'
- name: Do a site-install
run: docker-compose exec -u www-data -T www bash -c 'drush site-install farm --locale=en --db-url=pgsql://farm:farm@db/farm --site-name=Test0 --account-name=root --account-pass=test'
- name: Enable oauth prereqs via drush
run: docker-compose exec -u www-data -T www drush en simple_oauth_password_grant farm_api_default_consumer
- name: Add farmOS_wfs-2.x-dev via composer
run: docker-compose exec -T www composer require --with-all-dependencies symbioquine/farmos_wfs 2.x-dev
- name: Use drush to enable farmOS_wfs
run: docker-compose exec -u www-data -T www drush en farmos_wfs
- name: Perform Minimal Validation of a GetCapabilities Request
run: |
set -e
OAUTH2_ACCESS_TOKEN=`curl -X POST -d "grant_type=password&username=root&password=test&client_id=farm&scope=farm_manager" http://localhost/oauth/token | grep -Po 'access_token":"\K[^"]+'`
GET_CAPABILITIES_RESPONSE=`curl --header "Authorization: Bearer $OAUTH2_ACCESS_TOKEN" "http://localhost/wfs?SERVICE=WFS&REQUEST=GetCapabilities"`
echo $GET_CAPABILITIES_RESPONSE | grep -q '<ows:Title>farmOS OGC WFS API</ows:Title>'