Skip to content

Commit

Permalink
#3: Headless chrome tests part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Oct 24, 2021
1 parent 63ce391 commit 98a04b4
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/pr-chrome-headless-tests.yml
@@ -0,0 +1,69 @@
name: Headless Chrome Tests

on:
pull_request:

jobs:
leia-tests:
runs-on: ${{ matrix.os }}
env:
TERM: xterm
strategy:
matrix:
leia-tests:
- examples/chrome-headless-73
lando-versions:
- edge
os:
- ubuntu-20.04
node-version:
- '14'

steps:
# Install deps and cache
- name: Checkout code
uses: actions/checkout@v2
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile

# This block should eventually become use lando/actions-hyperdrive@v2
- name: Verify Docker dependencies
run: |
docker --version | grep "20.10."
docker-compose --version | grep "1.29."
- name: Grab latest edge Lando CLI
run: |
sudo curl -fsSL -o /usr/local/bin/lando "https://files.lando.dev/cli/lando-linux-x64-${{ matrix.lando-versions }}"
sudo chmod +x /usr/local/bin/lando
- name: Move in lando config appropriate for testing
run: |
mkdir -p ~/.lando/cache
cp -f actions-lando-config.yml ~/.lando/config.yml
echo false > ~/.lando/cache/report_errors
lando --clear
- name: Verify Lando works and we are dogfooding this plugin for tests
run: |
lando version
lando config --path plugins | grep platformsh | grep /home/runner/work/platformsh/platformsh || echo "::error:: Not dogfooding this plugin correctly! "
cd ${{ matrix.leia-tests }}
lando config --path plugins | grep platformsh | grep dir | grep /home/runner/work/platformsh/platformsh || echo "::error:: Not dogfooding this plugin correctly! "
# This block should eventually become use lando/actions-leia@v2
# @NOTE? Do we want a way for our leia-action to configure apparmor since
# this might break a whole bunch of tests? or is this literally just a thing
# for the platform.sh mysql/mariadb container?
- name: Configure apparmor
run: |
set -x
sudo apt-get remove mysql-server --purge
sudo apt-get install apparmor-profiles
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: Run leia tests
shell: bash
run: yarn leia "./${{ matrix.leia-tests }}/README.md" -c 'Destroy tests' --stdin --shell bash

3 changes: 3 additions & 0 deletions services/platformsh-chrome-headless/builder.js
Expand Up @@ -16,6 +16,9 @@ module.exports = {
constructor(id, options = {}, factory) {
options = _.merge({}, config, options);

// Make sure we get a localhost assignment for 9222
options.moreHttpPorts = ['9222'];

// Build chrome-headless
const chromeHeadless = {
image: `docker.registry.platform.sh/chrome-headless-${options.version}`,
Expand Down

0 comments on commit 98a04b4

Please sign in to comment.