-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2ced7d
commit 182ae25
Showing
13 changed files
with
373 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Integration tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 'main' | ||
- '*-release' | ||
|
||
jobs: | ||
docker: | ||
name: Docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out LORIS-MRI | ||
uses: actions/checkout@v4 | ||
|
||
- name: Clone the LORIS core repository | ||
run: git clone https://github.com/aces/Loris.git /tmp/Loris | ||
|
||
- name: Import database files | ||
run: | | ||
mkdir -p ./test/database | ||
mkdir -p ./test/database/SQL | ||
mkdir -p ./test/database/raisinbread/RB_files | ||
mkdir -p ./test/database/raisinbread/instruments/instrument_sql | ||
mkdir -p ./test/database/test/test_instrument | ||
cp -r /tmp/Loris/SQL/* ./test/database/SQL | ||
cp -r ./test/RB_SQL/* ./test/database/raisinbread/RB_files | ||
cp -r -n /tmp/Loris/raisinbread/RB_files/* ./test/database/raisinbread/RB_files | ||
cp -r /tmp/Loris/raisinbread/instruments/instrument_sql/* ./test/database/raisinbread/instruments/instrument_sql | ||
cp -r /tmp/Loris/test/test_instrument/testtest.sql ./test/database/test/test_instrument/testtest.sql | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build Docker database image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./test/db.Dockerfile | ||
build-args: | | ||
BASE_DIR=/app/ | ||
tags: loris-db | ||
load: true | ||
cache-from: type=gha,scope=loris-db | ||
cache-to: type=gha,scope=loris-db | ||
|
||
- name: Build Docker MRI image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./test/mri.Dockerfile | ||
tags: loris-mri | ||
load: true | ||
cache-from: type=gha,scope=loris-mri | ||
cache-to: type=gha,scope=loris-mri | ||
|
||
- name: Run integration tests | ||
run: docker compose --file ./test/docker-compose.yml run mri pytest python/tests/integration |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- This file contains a few statements to adapt a core LORIS database to LORIS-MRI. | ||
-- This file is ran by the installation or the database dockerfile, it usually | ||
-- should not be ran as a standalone. | ||
|
||
-- The script arguments must be set as SQL variables when calling the script. | ||
-- @email -- User email address | ||
-- @project -- Project name | ||
-- @minc_dir -- MINC Toolkit directory | ||
|
||
UPDATE Config SET Value = @email | ||
WHERE ConfigID = (SELECT ID FROM ConfigSettings WHERE Name = 'mail_user'); | ||
UPDATE Config SET Value = @project | ||
WHERE ConfigID = (SELECT ID FROM ConfigSettings WHERE Name = 'prefix'); | ||
UPDATE Config SET Value = @minc_dir | ||
WHERE ConfigID = (SELECT ID FROM ConfigSettings WHERE Name = 'MINCToolsPath'); | ||
UPDATE Config SET Value = CONCAT('/data/', @project, '/data/') | ||
WHERE ConfigID = (SELECT ID FROM ConfigSettings WHERE Name = 'dataDirBasepath'); | ||
UPDATE Config SET Value = CONCAT('/data/', @project, '/data/') | ||
WHERE ConfigID = (SELECT ID FROM ConfigSettings WHERE Name = 'imagePath'); | ||
UPDATE Config SET Value = CONCAT('/data/', @project, '/data/tarchive/') | ||
WHERE ConfigID = (SELECT ID FROM ConfigSettings WHERE Name = 'tarchiveLibraryDir'); | ||
UPDATE Config SET Value = CONCAT('/opt/', @project, '/bin/mri/dicom-archive/get_dicom_info.pl') | ||
WHERE ConfigID = (SELECT ID FROM ConfigSettings WHERE Name = 'get_dicom_info'); | ||
UPDATE Config SET Value = CONCAT('/opt/', @project, '/bin/mri/') | ||
WHERE ConfigID = (SELECT ID FROM ConfigSettings WHERE Name = 'MRICodePath'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
# tests/test_example.py | ||
# Proof-of-concept integration tests. TODO: Replace with real tests | ||
|
||
|
||
def test_addition(): | ||
assert 1 + 1 == 2 | ||
|
||
|
||
def test_subtraction(): | ||
assert 2 - 1 == 1 | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM mariadb:latest | ||
|
||
ARG BASE_DIR | ||
|
||
COPY test/database/SQL/0000-00-00-schema.sql /0000-00-00-schema.sql | ||
COPY test/database/SQL/0000-00-01-Modules.sql /0000-00-01-Modules.sql | ||
COPY test/database/SQL/0000-00-02-Permission.sql /0000-00-02-Permission.sql | ||
COPY test/database/SQL/0000-00-03-ConfigTables.sql /0000-00-03-ConfigTables.sql | ||
COPY test/database/SQL/0000-00-04-Help.sql /0000-00-04-Help.sql | ||
COPY test/database/SQL/0000-00-05-ElectrophysiologyTables.sql /0000-00-05-ElectrophysiologyTables.sql | ||
COPY test/database/raisinbread/RB_files/*.sql /RB_files/ | ||
COPY test/database/raisinbread/instruments/instrument_sql/aosi.sql /aosi.sql | ||
COPY test/database/raisinbread/instruments/instrument_sql/bmi.sql /bmi.sql | ||
COPY test/database/raisinbread/instruments/instrument_sql/medical_history.sql /medical_history.sql | ||
COPY test/database/raisinbread/instruments/instrument_sql/mri_parameter_form.sql /mri_parameter_form.sql | ||
COPY test/database/raisinbread/instruments/instrument_sql/radiology_review.sql /radiology_review.sql | ||
COPY test/database/test/test_instrument/testtest.sql /test_instrument.sql | ||
|
||
RUN echo "Use LorisTest;" | cat - \ | ||
0000-00-00-schema.sql \ | ||
0000-00-01-Modules.sql \ | ||
0000-00-02-Permission.sql \ | ||
0000-00-03-ConfigTables.sql \ | ||
0000-00-04-Help.sql \ | ||
0000-00-05-ElectrophysiologyTables.sql \ | ||
aosi.sql \ | ||
bmi.sql \ | ||
medical_history.sql \ | ||
mri_parameter_form.sql \ | ||
radiology_review.sql \ | ||
test_instrument.sql \ | ||
RB_files/*.sql > /docker-entrypoint-initdb.d/0000-compiled.sql | ||
|
||
RUN echo "Use LorisTest;" >> /docker-entrypoint-initdb.d/0001-paths.sql | ||
RUN echo "UPDATE Config SET Value='${BASE_DIR}/' WHERE ConfigID=(SELECT ID FROM ConfigSettings WHERE Name='base');" >> /docker-entrypoint-initdb.d/0001-paths.sql | ||
RUN echo "GRANT UPDATE,INSERT,SELECT,DELETE,DROP,CREATE TEMPORARY TABLES ON LorisTest.* TO 'SQLTestUser'@'%' IDENTIFIED BY 'TestPassword' WITH GRANT OPTION;" >> /docker-entrypoint-initdb.d/0004-sql-user.sql | ||
|
||
# Run the LORIS-MRI database installation script | ||
COPY install/install_database.sql /tmp/install_database.sql | ||
RUN echo "SET @email := 'root@localhost'; SET @project := 'loris'; SET @minc_dir = '/opt/minc/1.9.18';" >> 0001-paths.sql | ||
RUN cat /tmp/install_database.sql >> /docker-entrypoint-initdb.d/0001-paths.sql |
Oops, something went wrong.