Skip to content

Commit

Permalink
Merge pull request #32 from phac-nml/development
Browse files Browse the repository at this point in the history
Release 2.1.0
  • Loading branch information
JeffreyThiessen authored Feb 13, 2023
2 parents ed20aed + bb491c8 commit 07b0650
Show file tree
Hide file tree
Showing 27 changed files with 1,247 additions and 770 deletions.
58 changes: 0 additions & 58 deletions .ci/install_deps.sh

This file was deleted.

105 changes: 105 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Integration Tests

on:
pull_request: # Run on all pull requests
push:
branches: # Run on any push to development or main
- development
- main
schedule: # Run weekly on development and main
- cron: 0 2 * * 1
branches: development
- cron: 0 2 * * 1
branches: main


jobs:
build-unittests:
runs-on: ubuntu-20.04 #See pre-installed software at https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
strategy:
fail-fast: False #Setting so that if one of the test suites fail, the other will continue
matrix:
python-version: [ 3.6 ]

steps:
- uses: actions/checkout@v2 #Checkout the project from git
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run Unit Tests
run: make unittests

build-irida-integration:
runs-on: ubuntu-20.04 #See pre-installed software at https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
env:
MYSQL_PORT: 3306
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_DATABASE: irida_importer_test
MYSQL_HOST: 127.0.0.1
MYSQL_ROOT_PASSWORD: password
NODE_OPTIONS: "--max-old-space-size=4096"
CONDA_PREFIX: /usr/share/miniconda

strategy:
fail-fast: False #Setting so that if one of the test suites fail, the other will continue
matrix:
branch: ['main','development'] # IRIDA Branches to test against

steps:
- uses: actions/checkout@v2 #Checkout the project from git
- name: Setup MySQL
uses: mirromutth/mysql-action@v1.1
with:
host port: ${{ env.MYSQL_PORT }}
character set server: 'utf8'
collation server: 'utf8_general_ci'
mysql version: '5.7'
mysql database: ${{ env.MYSQL_DATABASE }}
mysql user: ${{ env.MYSQL_USER }}
mysql password: ${{ env.MYSQL_PASSWORD }}
mysql root password: ${{ env.MYSQL_ROOT_PASSWORD }} #The root superuser password
- name: Verify MySQL connection
timeout-minutes: 10
run: |
while ! mysqladmin ping -h"${{ env.MYSQL_HOST }}" -P"${{ env.MYSQL_PORT }}" --silent; do
sleep 1
done
- name: Set up JDK 11 # Installs java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: MySQL Setup (SUDO) # Sets ONLY_FULL_GROUP_BY flag and gives runner privileges over database
run: |
sudo mysql -e "SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));" -h ${{ env.MYSQL_HOST }} -P ${{ env.MYSQL_PORT }} -p${{ env.MYSQL_ROOT_PASSWORD }};
sudo mysql -e "CREATE USER '${{ env.MYSQL_USER }}'@'%' IDENTIFIED BY '${{ env.MYSQL_PASSWORD }}'; GRANT ALL ON ${{ env.MYSQL_DATABASE }}.* to '${{ env.MYSQL_USER }}'@'%';" -h ${{ env.MYSQL_HOST }} -P ${{ env.MYSQL_PORT }} -p${{ env.MYSQL_ROOT_PASSWORD }};
- name: Set up PostgreSQL
run: |
sudo apt-get update
sudo apt-get install postgresql libpq-dev
sudo service postgresql start
sudo -u postgres createuser --superuser "$USER"
createdb runner
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.6.7
activate-environment: __irida_importer_py3.6.7
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Install conda packages
shell: bash -l {0}
run: |
conda config --add channels defaults
conda config --add channels conda-forge
conda config --add channels bioconda
conda config --add channels iuc
conda install bioblend=0.13.0 oauthlib=3.0.1 requests=2.22.0 requests-oauthlib=1.2.0 simplejson=3.8.1
- name: Setup galaxy conda env
shell: bash -l {0}
run: conda create --name _galaxy_ python=3.7.6
- name: Run Integration Tests ${{ matrix.branch }}
timeout-minutes: 60
run: make integrationtests branch=${{ matrix.branch }} db_host=${{ env.MYSQL_HOST }} db_port=${{ env.MYSQL_PORT }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ env
/.venv
miniconda*
.vscode
.virtualenv
irida_import.egg-info
irida_import/tests/integration/tmp
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to irida-galaxy-importer will be documeted in this file.

## 2.1.0
* Added in support for importing IRIDA files that are not available locally (i.e. in the cloud)
* Switched from travisCI tests to Github Actions
* Switched integration tests to launch irida via gradle

## 2.0.0

* Added support for Python 3, while maintaining Python 2 support
Expand Down
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
SHELL=/bin/bash
IRIDA_VERSION?=main

requirements: clean env
source .virtualenv/bin/activate
python3 -m pip install -e .

clean:
rm -rf irida_import/.pytest_cache
rm -rf .virtualenv
rm -rf irida_import.egg-info/
find -name "*pyc" -delete
rm -rf /tmp/repos
rm -rf irida_import/tests/integration/tmp
rm -rf venv

env:
python3 -m venv .virtualenv
source .virtualenv/bin/activate
python3 --version
python3 -m pip install --upgrade wheel pip

unittests: clean env
source .virtualenv/bin/activate
pip3 install -e .
pip3 install pytest
pytest irida_import/tests/unit/*.py

integrationtests: clean env
source .virtualenv/bin/activate
python3 -m pip install -e .[TEST]
python3 -m pip install pytest
mkdir /tmp/repos
python3 irida_import/tests/integration/start_integration_tests.py $(branch) $(db_host) $(db_port)
27 changes: 10 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The Galaxy [tools/][galaxy-tools] directory contains tools that come with the Ga
```bash
cd galaxy/tools/

git clone -b master https://github.com/phac-nml/irida-galaxy-importer.git
git clone -b main https://github.com/phac-nml/irida-galaxy-importer.git
cd irida-galaxy-importer

# Optional. Checkout specific release from https://github.com/phac-nml/irida-galaxy-importer/releases
Expand Down Expand Up @@ -181,7 +181,7 @@ You will next want to make the appropriate changes with your connection informat
### MODIFY THESE ###
admin_key: d9c54f0b38b75dd6513035e4dd786a0b
galaxy_url: http://localhost:48888
galaxy_url: http://127.0.0.1:48888
####################
illumina_path: /illumina_reads
Expand All @@ -196,7 +196,7 @@ client_http_retry_delay: 30
### MODIFY THESE ###
client_secret: qlB82t7Ct917127lL7oQ82bd9o2iAP8bT0rJohpz7s
client_id: galaxy
irida_url: http://localhost:8080
irida_url: http://127.0.0.1:8080
####################
initial_endpoint_suffix: /projects
Expand Down Expand Up @@ -246,7 +246,7 @@ If you wish to make additions to the code, the below instructions can be used to
The script `run-tests.sh` can be used to run the tests. This should check for some of the dependencies and let you know which is missing. However, you will have to have the following dependencies installed:

* Java 11
* Maven
* Gradle
* MySQL/MariaDB (Server and Client)
* PostgreSQL (Server and Client)
* Git
Expand All @@ -256,7 +256,7 @@ The script `run-tests.sh` can be used to run the tests. This should check for so
On Ubuntu, you can install these with:

```bash
sudo apt-get install openjdk-11-jdk maven mariadb-client mariadb-server postgresql git chromium-chromedriver xvfb
sudo apt-get install openjdk-11-jdk gradle mariadb-client mariadb-server postgresql git chromium-chromedriver xvfb
```

MySQL must be configured to grant all privileges to the user `test` with password `test` for the databases `irida_test`. MySQL must also be configured to disable `ONLY_FULL_GROUP_BY` mode.
Expand All @@ -268,25 +268,18 @@ mysql -u root -e "SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROU
```

## 3.2. Running tests

To run all the test, you can run:

```bash
./run-tests.sh
```

If you just want to run just the unit tests (much quicker) you can do:
Unit tests can be run with:

```bash
./run-tests.sh unit
make unittests
```

If you just want to run just the integration tests you can do:
Integration tests can be run with

```bash
./run-tests.sh integration
make integrationtests branch=main
```

This tests against the `main` branch of IRIDA

[galaxy]: https://galaxyproject.org/
[irida]: https://www.irida.ca/
Expand Down
6 changes: 3 additions & 3 deletions irida_import/extras/apache2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}).config(function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
'self',
'http://localhost/**'
'http://127.0.0.1/**'
]);
}).controller('galaxyController', ['$scope', '$http', '$window', '$location','$timeout', galaxyController]);

Expand Down Expand Up @@ -73,9 +73,9 @@

sampleFilePaths = [
"http://www.dgfdg.com/sample1file1",
"file://localhost/home/jthiessen/lib_imp_dir/test/test.fastq"
"file://127.0.0.1/home/jthiessen/lib_imp_dir/test/test.fastq"
];
addSample("thisissample1'sname","http://localhost/some_IRIDA_API_path/Projects/1/Samples/1",sampleFilePaths);
addSample("thisissample1'sname","http://127.0.0.1/some_IRIDA_API_path/Projects/1/Samples/1",sampleFilePaths);
$timeout(
function(){
document.getElementById("samplesSubmit").submit();
Expand Down
2 changes: 1 addition & 1 deletion irida_import/extras/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ events {}

http {
upstream galaxy_app {
server localhost:8888;
server 127.0.0.1:8888;
}

server {
Expand Down
Loading

0 comments on commit 07b0650

Please sign in to comment.