Collection of integration tests to run against a live server. Tests use a java http client to test the molgenis API.
REST_TEST_HOST=[url_of_live_molgenis_to_test_against]
// default http://localhost:8080
REST_TEST_ADMIN_NAME=[name_of_admin_user]
// user name of user that acts as 'admin' user, this user is used to for test setup and teardown
REST_TEST_ADMIN_PW=[password_for_admin_users]
mvn test -Dtest=[RestControllerIT,...comma-separated-list-of-test-classes] -DREST_TEST_HOST="http://localhost:8080" -DREST_TEST_ADMIN_NAME="[admin_name]" -DREST_TEST_ADMIN_PW="[admin_pw]"
The class ImportPublicDataIT
is used as a template for running tests that upload public customer data to live molgenis server.
The test uploads a file and checks if the upload was successful. After the test has run the imported data is removed using the supplied package or list of entities.
Supported file types: .xlsx and .vcf (make sure the file name is a valid molgenis entity id)
The data sets are maintained on the download server. You need authentication to access them. You can find the credentials in the Vault. you need to be able to access the MOLGENIS.
If you want to update the data you can file a request to the datateam for new sets. Be advised that you have to use the same names as before for new sets.
All of the above mentioned maven properties + the following environment variables
MOLGENIS_TEST_UPLOAD_FOLDER
// path to folder to load data files from
MOLGENIS_TEST_UPLOAD_FILE
// file to use in test
MOLGENIS_TEST_UPLOAD_PACKAGE_TO_REMOVE
// optional package to delete after test (success or failure)
MOLGENIS_TEST_UPLOAD_ENTITIES_TO_REMOVE
// optional comma separated list of entities to remove after test (success or failure)
MOLGENIS_TEST_UPLOAD_CHECK_URLS
// comma separated list of urls to test via GET for testing successful upload
note: You have to run MOLGENIS locally to execute the tests.
For Mac and Linux:
molgenis-api-tests/env_import_public_data_tests.bash
For Windows execute:
molgenis-api-tests/env_import_public_data_tests.bat
note: make sure you have MAVEN on your PATH for Linux, Mac and Windows
note: You have to run MOLGENIS locally to execute the tests.
To run the tests in IntelliJ you have to do the following steps:
- Import test on time to automatically create a runtime configuration
- Edit runtime configuration
- Open "Environment variables"
- Copy all the variables from this file
molgenis-api-tests/env_import_public_data_tests.bash
. - Use the "clipboard"-button to paste the environment into the runtime configuration
- Click on "Ok" to save the configuration
- Add to the following MAVEN properties to the "VM options":
-DREST_TEST_HOST="http://localhost:8080" -DREST_TEST_ADMIN_NAME="[admin_name]" -DREST_TEST_ADMIN_PW="[admin_pw]"
We run separate builds for each individual customer. To add a job for a new customer please check the existing builds. You can copy a job and update the configuration.
You can modify this job on: Github - molgenis-helm