forked from EBISPOT/ols4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api.sh
More file actions
executable file
·47 lines (36 loc) · 1.15 KB
/
Copy pathtest_api.sh
File metadata and controls
executable file
·47 lines (36 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
export OLS4_CONFIG=$(find testcases | grep json | paste -sd, -)
export OLS4_DATALOAD_ARGS="--loadLocalFiles"
export BUILDKIT_PROGRESS=plain
export OLS_ORCID_NAME_FIXTURE="${OLS_ORCID_NAME_FIXTURE:-$(pwd)/dev-testing/orcid-name-fixture.json}"
rm -rf testcases_output_api/*
mkdir -p testcases_output_api
EXIT_CODE=0
# some mock embeddings for duo we can use in tests
export OLS_EMBEDDINGS_PATH=./testcases/embeddings
# test curated text-to-term mappings (SSSOM)
export OLS4_CURATIONS_PATH=./testcases/curations/*.sssom.tsv
rm -rf tmp out
./dataload.sh
if [[ "$?" != "0" ]]
then
EXIT_CODE=1
echo Dataload returned a non-zero exit code
exit $EXIT_CODE
fi
HOST_UID=$(id -u) HOST_GID=$(id -g) docker compose --profile run-api-tests \
up \
--force-recreate \
--always-recreate-deps \
-V \
--exit-code-from run-api-tests \
run-api-tests
if [[ "$?" != "0" ]]
then
EXIT_CODE=1
echo Test $TEST_FOLDER returned a non-zero exit code, so the API tests will report failure
fi
cat testcases_output_api/apitester4.log
HOST_UID=$(id -u) HOST_GID=$(id -g) docker compose down -t 120 -v
echo API test exit code: $EXIT_CODE
exit $EXIT_CODE