mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
feat: add test steps to Linux workflow
This commit is contained in:
parent
265080453a
commit
fe0f41cecb
13
.github/workflows/linux-build-on-release.yml
vendored
13
.github/workflows/linux-build-on-release.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Build Wakapi on Linux
|
name: Linux
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -10,7 +10,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-release:
|
build-and-release:
|
||||||
name: Build
|
name: Linux - Build, Test & Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
@ -24,8 +24,15 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
|
run: go get
|
||||||
|
|
||||||
|
- name: Unit Tests
|
||||||
|
run: go test ./... -run ./...
|
||||||
|
|
||||||
|
- name: API Tests
|
||||||
run: |
|
run: |
|
||||||
go get
|
npm -g install newman
|
||||||
|
./testing/run_api_tests.sh
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: GO111MODULE=on go build -v .
|
run: GO111MODULE=on go build -v .
|
||||||
|
4
.github/workflows/win-build-on-release.yml
vendored
4
.github/workflows/win-build-on-release.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Build Wakapi on Windows
|
name: Windows
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -10,7 +10,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-release:
|
build-and-release:
|
||||||
name: Build
|
name: Windows - Build & Release
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
@ -306,10 +306,7 @@ To get a predictable environment, tests are run against a fresh and clean Wakapi
|
|||||||
# 1. sqlite (cli)
|
# 1. sqlite (cli)
|
||||||
$ sudo apt install sqlite # Fedora: sudo dnf install sqlite
|
$ sudo apt install sqlite # Fedora: sudo dnf install sqlite
|
||||||
|
|
||||||
# 2. screen
|
# 2. newman
|
||||||
$ sudo apt install screen # Fedora: sudo dnf install screen
|
|
||||||
|
|
||||||
# 3. newman
|
|
||||||
$ npm install -g newman
|
$ npm install -g newman
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -20,7 +20,8 @@ echo "Importing seed data ..."
|
|||||||
sqlite3 wakapi_testing.db < data.sql
|
sqlite3 wakapi_testing.db < data.sql
|
||||||
|
|
||||||
echo "Running Wakapi testing instance in background ..."
|
echo "Running Wakapi testing instance in background ..."
|
||||||
screen -S wakapi_testing -dm bash -c "../wakapi -config config.testing.yml"
|
../wakapi -config config.testing.yml &
|
||||||
|
pid=$!
|
||||||
|
|
||||||
echo "Waiting for Wakapi to come up ..."
|
echo "Waiting for Wakapi to come up ..."
|
||||||
until $(curl --output /dev/null --silent --get --fail http://localhost:3000/api/health); do
|
until $(curl --output /dev/null --silent --get --fail http://localhost:3000/api/health); do
|
||||||
@ -34,7 +35,7 @@ echo "Running test collection ..."
|
|||||||
newman run "Wakapi API Tests.postman_collection.json"
|
newman run "Wakapi API Tests.postman_collection.json"
|
||||||
|
|
||||||
echo "Shutting down Wakapi ..."
|
echo "Shutting down Wakapi ..."
|
||||||
screen -S wakapi_testing -X quit
|
kill -TERM $pid
|
||||||
|
|
||||||
echo "Deleting database ..."
|
echo "Deleting database ..."
|
||||||
rm wakapi_testing.db
|
rm wakapi_testing.db
|
Loading…
Reference in New Issue
Block a user