Skip to content

Commit

Permalink
add tests CI
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jun 9, 2024
1 parent 85e1749 commit 198f8bd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ NCBO_ANNOTATORPLUS_ENABLED=false
SUPPORT_EMAIL=sifrportal-support@lirmm.fr
RELEASE_VERSION="OntoPortal Appliance 3.0.1"
USE_RECAPTCHA=false
ANNOTATOR_URL=""

##################### KAMAL configuration ####################
IMAGE_NAME=
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Run docker scripts tests CI"

on:
push:
pull_request:
types: [opened, reopened]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: "recursive" # Make sure submodules are fetched recursively

- name: Run OntoPortal Docker tests
run: test/run_test.sh
3 changes: 1 addition & 2 deletions test/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#!/usr/bin/env bash
./test/bats/bin/bats ./test/tests.sh

TERM=xterm test/bats/bin/bats -T --verbose-run test/tests.sh
7 changes: 5 additions & 2 deletions test/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ setup() {
load 'test_helper/bats-assert/load'
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
PATH="$DIR/../src:$PATH"
./ontoportal clean -f
}

@test "Running and Stopping API" {
./ontoportal clean -f

run ./ontoportal start api
assert_output --partial "[+] API is up and running!"
refute_output --partial 'error'
Expand All @@ -20,6 +21,7 @@ setup() {
}

@test "Running and Stopping UI" {
./ontoportal clean -f

./ontoportal start api

Expand All @@ -29,7 +31,8 @@ setup() {
refute_output --partial 'error'
refute_output --partial 'ERROR'

./ontoportal stop ui
./ontoportal stop api
./ontoportal stop ui

run docker compose -f docker-compose_ui.yml ps
assert_output "NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS"
Expand Down

0 comments on commit 198f8bd

Please sign in to comment.