Skip to content

Commit

Permalink
Cleanup functional testing pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Karl Hepworth <[email protected]>
  • Loading branch information
fubarhouse committed Jun 27, 2024
1 parent 4e8e3b5 commit 563fa35
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 deletions .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ provider-model ]

jobs:
setup-mysql:
test:
runs-on: ubuntu-latest

steps:
Expand All @@ -17,41 +17,33 @@ jobs:
with:
go-version: '1.21'

- name: Start MySQL
- name: Build MTK
run: make build

- name: MySQL:Start
run: sudo /etc/init.d/mysql start

- name: Create Database
- name: Database:Create
run: mysql -e 'CREATE DATABASE test_db;' -uroot -proot

- name: Import database
- name: Database:Import
run: mysql -uroot -proot test_db < .github/workflows/functional-test.sql

- name: Build MTK
run: make build

- name: Dump database
- name: Database:Dump
run: bin/mtk-linux-amd64 dump test_db --port=3306 --user=root --password=root --host=127.0.0.1 > mtk-dump.sql

- name: Drop Database
- name: Database:Drop
run: mysql -e 'DROP DATABASE test_db;' -uroot -proot

- name: Clean database file
run: |
sed '$d' mtk-dump.sql > mtk-dump-clean.sql
- name: Database:Clean
# Remove the last line from the file - the dump timestamp.
run: sed '$d' mtk-dump.sql > mtk-dump-clean.sql

- name: Create Database
- name: Database:Recreate
run: mysql -e 'CREATE DATABASE test_db;' -uroot -proot

- name: Import database
- name: Database:Reimport
run: mysql -uroot -proot test_db < mtk-dump-clean.sql

- name: Upload diff as artifact
uses: actions/upload-artifact@v2
with:
name: file-diff
path: |
.github/workflows/functional-test.sql
mtk-dump-clean.sql
- name: Generate diff
- name: Compare results
run: diff -q .github/workflows/functional-test.sql mtk-dump-clean.sql

0 comments on commit 563fa35

Please sign in to comment.