Skip to content

Commit

Permalink
Run integration tests as part of review checks
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Styk <[email protected]>
  • Loading branch information
StykMartin committed Dec 23, 2023
1 parent 144164f commit 2bd9afd
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/review-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,69 @@ jobs:
name: beaker-docs
path: /home/runner/work/html

integration-tests:
runs-on: ubuntu-latest
env:
MYSQL_USER: beaker
MYSQL_PASSWORD: beaker
MYSQL_ROOT_PASSWORD: toor
strategy:
fail-fast: false
matrix:
test-target: ["bkr.inttest.client"]
container:
image: centos:7
services:
database:
image: mariadb:latest
env:
MYSQL_USER: ${{ env.MYSQL_USER }}
MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_ROOT_PASSWORD }}
ports:
- 3306
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Add Beaker Server YUM repository
run: |
curl -o /etc/yum.repos.d/beaker-server.repo https://beaker-project.org/yum/beaker-server-RedHatEnterpriseLinux.repo
- name: Install Beaker dependencies
run: |
pwd
ls -la
yum install epel-release mariadb beaker-integration-tests -y
yum-builddep beaker.spec -y
yum remove beaker-common \
beaker-client \
beaker-lab-controller \
beaker-server \
beaker-integration-tests -y
- name: Checkout submodules
run: |
pwd
ls -la
git submodule update --init --recursive
- name: Configure database for testing
run: |
set -x
cat <<EOT > init.sql
CREATE DATABASE beaker_test;
CREATE DATABASE beaker_migration_test;
GRANT ALL PRIVILEGES ON beaker_test.* TO 'beaker'@'%';
GRANT ALL PRIVILEGES ON beaker_migration_test.* TO 'beaker'@'%';
EOT
mysql -uroot -p${{ env.MYSQL_ROOT_PASSWORD }} -h database < init.sql
sed -i 's/@localhost/@database/g' IntegrationTests/server-test.cfg
cat IntegrationTests/server-test.cfg
- name: Run integration tests for ${{ matrix.test-target }}
run: |
pushd IntegrationTests
./run-tests.sh ${{ matrix.test-target }}

0 comments on commit 2bd9afd

Please sign in to comment.