Skip to content

test #1169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 17 commits into from
Closed

test #1169

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions .github/workflows/loristest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: LORIS Test Suite
name: LORIS-MRI Test Suite

on:
- push
Expand Down Expand Up @@ -26,17 +26,24 @@ jobs:
php-version: ${{ matrix.php }}
extensions: zip, php-ast


- name: Clone Loris repo
run: git clone https://github.com/aces/Loris.git

- name: Override Test Files
run: |
cp test/Dockerfile.test.php8 Loris/
cp test/Dockerfile.test.py Loris/
cp test/docker-compose.yml Loris/
cp test/phpunit.xml Loris/test/
cp test/RB_SQL/* Loris/raisinbread/RB_files/

- name: List directory contents
run: ls -la

- name: Build LORIS-MRI-PYTEST
run: |
docker compose -f test/docker-compose.yml up --build --exit-code-from pytest

- name: Validate composer.json and composer.lock
run: |
cd Loris
Expand Down Expand Up @@ -78,15 +85,3 @@ jobs:
cd Loris
make dev

- name: Run Test Suite
run: |
# set sandbox to 1 before running the tests
# since some tests only run in sandbox environments
sed -i 's/<sandbox>0<\/sandbox>/<sandbox>1<\/sandbox>/g' Loris/test/config.xml
cd Loris
npm run tests:${{ matrix.testsuite }}
env:
# Specifies how many jobs you would like to run in parallel,
CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
# Use the index from matrix as an environment variable
CI_NODE_INDEX: ${{ matrix.ci_node_index }}
10 changes: 10 additions & 0 deletions test/Dockerfile.test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Dockerfile
FROM python:3.11.3-slim

Check failure on line 2 in test/Dockerfile.test.py

View workflow job for this annotation

GitHub Actions / flake8-lint (3.11)

[flake8] reported by reviewdog 🐶 SyntaxError: invalid syntax Raw Output: ./test/Dockerfile.test.py:2:7: E999 SyntaxError: invalid syntax

Check failure on line 2 in test/Dockerfile.test.py

View workflow job for this annotation

GitHub Actions / flake8-lint (3.12)

[flake8] reported by reviewdog 🐶 SyntaxError: invalid syntax Raw Output: ./test/Dockerfile.test.py:2:7: E999 SyntaxError: invalid syntax

WORKDIR /app

COPY test/hello-world-pytest /app/test/hello-world-pytest

RUN pip install pytest

CMD ["pytest","/app/test/hello-world-pytest"]
8 changes: 7 additions & 1 deletion test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
version: '2'
version: '3'
services:
pytest:
build:
context: .
dockerfile: Dockerfile.test.py
command: pytest /app/test/hello-world-pytest

db:
build:
context: .
Expand Down
3 changes: 3 additions & 0 deletions test/hello-world-pytest/hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# hello.py
def say_hello():
return "Hello, World!"
5 changes: 5 additions & 0 deletions test/hello-world-pytest/test_hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# test_hello.py
from hello import say_hello

def test_say_hello():

Check failure on line 4 in test/hello-world-pytest/test_hello.py

View workflow job for this annotation

GitHub Actions / flake8-lint (3.11)

[flake8] reported by reviewdog 🐶 expected 2 blank lines, found 1 Raw Output: ./test/hello-world-pytest/test_hello.py:4:1: E302 expected 2 blank lines, found 1

Check failure on line 4 in test/hello-world-pytest/test_hello.py

View workflow job for this annotation

GitHub Actions / flake8-lint (3.12)

[flake8] reported by reviewdog 🐶 expected 2 blank lines, found 1 Raw Output: ./test/hello-world-pytest/test_hello.py:4:1: E302 expected 2 blank lines, found 1
assert say_hello() == "Hello, World!"
Loading