Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/NewUpdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Download latest generators
run: |
cd .updater/openapi_generator
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.10.0/openapi-generator-cli-7.10.0.jar -O openapi-generator-cli.jar
wget -nv https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.10.0/openapi-generator-cli-7.10.0.jar -O openapi-generator-cli.jar
java -jar openapi-generator-cli.jar version > version
- name: Download latest Sirius Release
uses: nick-fields/retry@v2
Expand All @@ -34,7 +34,7 @@ jobs:
echo "Writing Version files: $packageVersion"
echo $packageVersion > ./packageVersion.txt
echo "Downloading Version: $packageVersion"
cat ./releases.json | grep 'browser_download_url.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d : -f 2,3 | tr -d \" | wget -i -
cat ./releases.json | grep 'browser_download_url.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d : -f 2,3 | tr -d \" | wget -nv -i -
echo "Download Complete"
unzip *.zip
echo "Api Ready"
Expand All @@ -45,7 +45,7 @@ jobs:
run: |
while ! nc -z localhost 8080; do sleep 0.1; done
cd .updater/api
wget http://localhost:8080/v3/api-docs -O api-docs-strings.json
wget -nv http://localhost:8080/v3/api-docs -O api-docs-strings.json
- name: Shutdown SIRIUS
run: curl -X POST http://localhost:8080/actuator/shutdown
- name: Run Rest Api with enums
Expand All @@ -55,7 +55,7 @@ jobs:
run: |
while ! nc -z localhost 8080; do sleep 0.1; done
cd .updater/api
wget http://localhost:8080/v3/api-docs -O api-docs-enums.json
wget -nv http://localhost:8080/v3/api-docs -O api-docs-enums.json
- name: Shutdown SIRIUS
run: curl -X POST http://localhost:8080/actuator/shutdown
- name: Update Clients
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/PythonTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ jobs:
- name: Change HOME to working directory of runner
run: echo "HOME=/home/runner/work/sirius-client-openAPI" >> $GITHUB_ENV
- name: Download tomato_small project space
run: wget ${{ secrets.TOMATO_SMALL_DOWNLOAD_LINK }} -O $HOME/tomato_small.sirius
run: |
wget -nv ${{ secrets.TOMATO_SMALL_DOWNLOAD_LINK }} -O $HOME/tomato_small.sirius
chmod 666 $HOME/tomato_small.sirius
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
75 changes: 72 additions & 3 deletions .github/workflows/RTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ jobs:
path: .updater/api/sirius
key: sirius
fail-on-cache-miss: true
- name: Download tomato_small project space
run: wget ${{ secrets.TOMATO_SMALL_DOWNLOAD_LINK }} -O tomato_small.sirius
- name: Change HOME to working directory of runner
run: echo "HOME=/home/runner/work/sirius-client-openAPI" >> $GITHUB_ENV
- name: Download tomato_small project space
run: |
wget -nv ${{ secrets.TOMATO_SMALL_DOWNLOAD_LINK }} -O $HOME/tomato_small.sirius
chmod 666 $HOME/tomato_small.sirius
- name: Check SIRIUS download
run: |
echo "Show content of cache download (.updater/api/)"
Expand Down Expand Up @@ -73,8 +75,75 @@ jobs:
quit(status=1)
}
shell: Rscript {0}
- name: Test Actuator API
if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success'
run: |
library(Rsirius)
library(testthat)
multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new()))
test_file("client-api_r/generated/tests/testthat/test_actuator_api.R", reporter=multi_reporter)
shell: Rscript {0}
- name: Test Info API
if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success'
run: |
testthat::test_file("client-api_r/generated/tests/testthat/test_info_api.R")
library(Rsirius)
library(testthat)
multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new()))
test_file("client-api_r/generated/tests/testthat/test_info_api.R", reporter=multi_reporter)
shell: Rscript {0}
- name: Test Login and Account API
if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success'
run: |
library(Rsirius)
library(testthat)
multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new()))
test_file("client-api_r/generated/tests/testthat/test_login_and_account_api.R", reporter=multi_reporter)
shell: Rscript {0}
- name: Test Projects API
if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success'
run: |
library(Rsirius)
library(testthat)
multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new()))
test_file("client-api_r/generated/tests/testthat/test_projects_api.R", reporter=multi_reporter)
shell: Rscript {0}
- name: Test Compounds API
if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success'
run: |
library(Rsirius)
library(testthat)
multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new()))
test_file("client-api_r/generated/tests/testthat/test_compounds_api.R", reporter=multi_reporter)
shell: Rscript {0}
- name: Test Databases API
if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success'
run: |
library(Rsirius)
library(testthat)
multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new()))
test_file("client-api_r/generated/tests/testthat/test_searchable_databases_api.R", reporter=multi_reporter)
shell: Rscript {0}
- name: Test Features API
if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success'
run: |
library(Rsirius)
library(testthat)
multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new()))
test_file("client-api_r/generated/tests/testthat/test_features_api.R", reporter=multi_reporter)
shell: Rscript {0}
- name: Test Jobs API
if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success'
run: |
library(Rsirius)
library(testthat)
multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new()))
test_file("client-api_r/generated/tests/testthat/test_jobs_api.R", reporter=multi_reporter)
shell: Rscript {0}
- name: Test acceptance
if: always() && steps.api_start.outcome == 'success' && steps.rsirius_install.outcome == 'success' && steps.login.outcome == 'success'
run: |
library(Rsirius)
library(testthat)
multi_reporter = MultiReporter$new(reporters=list(SummaryReporter$new(), FailReporter$new()))
test_file("client-api_r/generated/tests/testthat/test_acceptance.R", reporter=multi_reporter)
shell: Rscript {0}
8 changes: 4 additions & 4 deletions .github/workflows/update-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
timeout_minutes: 2
command: |
cd .updater/api
curl -s https://api.github.com/repositories/94561614/releases | grep 'browser_download_url.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d : -f 2,3 | tr -d \" | wget -i - echo "Download Complete"
curl -s https://api.github.com/repositories/94561614/releases | grep 'browser_download_url.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d : -f 2,3 | tr -d \" | wget -nv -i - echo "Download Complete"
unzip -o *.zip
echo "Api Ready"
- name: Check cached version
Expand All @@ -31,11 +31,11 @@ jobs:
command: |
cd .updater/api
currVersion=$(cat ./sirius/HashCode)
curl -s https://api.github.com/repositories/94561614/releases | grep 'browser_download_url.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d : -f 2,3 | tr -d \" | wget -i - newVersion=$(cat *.sha256 | cut -d " " -f 1)
curl -s https://api.github.com/repositories/94561614/releases | grep 'browser_download_url.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d : -f 2,3 | tr -d \" | wget -nv -i - newVersion=$(cat *.sha256 | cut -d " " -f 1)
echo New Version is $newVersion
if [ "$currVersion" != "$newVersion" ]; then
sleep 1
curl -s https://api.github.com/repositories/94561614/releases | grep 'browser_download_url.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d : -f 2,3 | tr -d \" | wget -i -
curl -s https://api.github.com/repositories/94561614/releases | grep 'browser_download_url.*linux-x64.zip\"' | sort | tac | head -n 1 | cut -d : -f 2,3 | tr -d \" | wget -nv -i -
unzip -o *.zip
echo $newVersion > ./sirius/HashCode
fi
fi
7 changes: 0 additions & 7 deletions client-api_python/generated/test/test_features_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ def setUp(self) -> None:
self.aligned_feature_id = "586487307819356741"

self.formula_candidates = self.api.features().get_formula_candidates(self.project_id, self.aligned_feature_id)
print("########### DEBUG ###########")
print("Project info:")
print(self.project_info)
print("Candidates for MSNovelist feature:")
print(self.formula_candidates)
print("All Features:")
print(self.api.features().get_aligned_features(self.project_id))
self.formula_id = self.formula_candidates[0].formula_id

def tearDown(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion client-api_r/generated/R/api_client.R
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ ApiClient <- R6::R6Class(
}

# not json mime type, simply return the first one
return(headers[1])
return(headers[[1]])
}
}
)
Expand Down
2 changes: 1 addition & 1 deletion client-api_r/generated/tests/testthat/test_acceptance.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ context("Test Acceptance")
options(warn = -1)

sdk <- SiriusSDK$new()
api <- sdk$attach_to_sirius()
api <- sdk$attach_to_sirius(sirius_port=8080)
api_instance <- api$jobs_api
features_api <- api$features_api
projects_api <- api$projects_api
Expand Down
2 changes: 1 addition & 1 deletion client-api_r/generated/tests/testthat/test_actuator_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
context("Test ActuatorApi")

sdk <- SiriusSDK$new()
api <- sdk$attach_to_sirius()
api <- sdk$attach_to_sirius(sirius_port=8080)
api_instance <- api$actuator_api

test_that("Health", {
Expand Down
2 changes: 1 addition & 1 deletion client-api_r/generated/tests/testthat/test_compounds_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
context("Test CompoundsApi")

sdk <- SiriusSDK$new()
api <- sdk$attach_to_sirius()
api <- sdk$attach_to_sirius(sirius_port=8080)
api_instance <- api$compounds_api
projects_api <- api$projects_api

Expand Down
2 changes: 1 addition & 1 deletion client-api_r/generated/tests/testthat/test_features_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ context("Test FeaturesApi")
options(warn = -1)

sdk <- SiriusSDK$new()
api <- sdk$attach_to_sirius()
api <- sdk$attach_to_sirius(sirius_port=8080)
api_instance <- api$features_api
projects_api <- api$projects_api

Expand Down
2 changes: 1 addition & 1 deletion client-api_r/generated/tests/testthat/test_info_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
context("Test InfoApi")

sdk <- SiriusSDK$new()
api <- sdk$attach_to_sirius()
api <- sdk$attach_to_sirius(sirius_port=8080)
api_instance <- api$info_api

test_that("GetConnectionCheck", {
Expand Down
6 changes: 3 additions & 3 deletions client-api_r/generated/tests/testthat/test_jobs_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ context("Test JobsApi")
options(warn=-1)

sdk <- SiriusSDK$new()
api <- sdk$attach_to_sirius()
api <- sdk$attach_to_sirius(sirius_port=8080)
api_instance <- api$jobs_api
features_api <- api$features_api
projects_api <- api$projects_api
Expand All @@ -32,7 +32,7 @@ test_that("DeleteJob", {
projects_api$ImportPreprocessedDataAsJob(project_id, input_files=input_file)

response_before <- api_instance$GetJobs(project_id)
api_instance$DeleteJob(project_id, response_before[[1]]$id)
api_instance$DeleteJob(project_id, response_before[[1]]$id, await_deletion=TRUE)
response_after <- api_instance$GetJobs(project_id)
expect_equal(length(response_before), length(response_after)+1)

Expand Down Expand Up @@ -92,7 +92,7 @@ test_that("DeleteJobs", {
projects_api$ImportPreprocessedDataAsJob(project_id, input_files=input_file)

response_before <- api_instance$GetJobs(project_id)
api_instance$DeleteJobs(project_id)
api_instance$DeleteJobs(project_id, await_deletion=TRUE)
response_after <- api_instance$GetJobs(project_id)
expect_equal(length(response_before), length(response_after)+1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
context("Test LoginAndAccountApi")

sdk <- SiriusSDK$new()
api <- sdk$attach_to_sirius()
api <- sdk$attach_to_sirius(sirius_port=8080)
api_instance <- api$login_and_account_api

test_that("GetAccountInfo", {
Expand All @@ -26,7 +26,6 @@ test_that("GetSignUpURL", {
# Get SignUp URL (For signUp via web browser)
# @return [character]

# TODO deserialize error
response <- api_instance$GetSignUpURL()
expect_true(inherits(response, "character"))
})
Expand Down
2 changes: 1 addition & 1 deletion client-api_r/generated/tests/testthat/test_projects_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
context("Test ProjectsApi")

sdk <- SiriusSDK$new()
api <- sdk$attach_to_sirius()
api <- sdk$attach_to_sirius(sirius_port=8080)
api_instance <- api$projects_api
path_to_demo_data <- paste(Sys.getenv("HOME"), "sirius-client-openAPI/.updater/clientTests/Data", sep = "/")
preproc_ms2_file_1 <- paste(path_to_demo_data, "Kaempferol.ms", sep = "/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
context("Test SearchableDatabasesApi")

sdk <- SiriusSDK$new()
api <- sdk$attach_to_sirius()
api <- sdk$attach_to_sirius(sirius_port=8080)
api_instance <- api$searchable_databases_api
home_dir <- Sys.getenv("HOME")
path_to_demo_data <- paste(home_dir, "sirius-client-openAPI/.updater/clientTests/Data", sep = "/")
Expand Down
2 changes: 1 addition & 1 deletion client-api_r/templates/r/api_client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ ApiClient <- R6::R6Class(
}

# not json mime type, simply return the first one
return(headers[1])
return(headers[[1]])
}
}
)
Expand Down