forked from uniqueg/cwl-example-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintegration_tests.sh
executable file
·107 lines (98 loc) · 3.74 KB
/
integration_tests.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/env bash
set -euo pipefail
WES_ROOT="http://localhost:8081/ga4gh/wes/v1"
# GET /runs
ENDPOINT="/runs"
METHOD="GET"
EXPECTED_CODE="200"
echo -n "Testing '$METHOD $ENDPOINT' | Expecting: $EXPECTED_CODE | Got: "
RESPONSE_CODE=$(curl \
--silent \
--write-out "%{http_code}" \
--output "/dev/null" \
--request "$METHOD" \
--header "Accept: application/json" \
"${WES_ROOT}${ENDPOINT}" \
)
echo -n "$RESPONSE_CODE | Result: "
test $RESPONSE_CODE = $EXPECTED_CODE && echo "PASSED" || (echo "FAILED" && exit 1)
# POST /runs 200
ENDPOINT="/runs"
METHOD="POST"
EXPECTED_CODE="200"
echo -n "Testing '$METHOD $ENDPOINT' | Expecting: $EXPECTED_CODE | Got: "
RESPONSE_CODE=$(curl \
--silent \
--write-out '%{http_code}' \
--output /dev/null \
--request "$METHOD" \
--header "Accept: application/json" \
--header "Content-Type: multipart/form-data" \
--form workflow_params='{"input":{"class":"File","path":"https://raw.githubusercontent.com/LCSB-BioCore/cwl-example-workflows/master/resources/test.txt"}}' \
--form workflow_type="CWL" \
--form workflow_type_version="v1.0" \
--form workflow_url="https://github.com/LCSB-BioCore/cwl-example-workflows/blob/master/hashsplitter-workflow.cwl" \
"${WES_ROOT}${ENDPOINT}"
)
echo -n "$RESPONSE_CODE | Result: "
test $RESPONSE_CODE = $EXPECTED_CODE && echo "PASSED" || (echo "FAILED" && exit 1)
# POST /runs 200 with trs tool
ENDPOINT="/runs"
METHOD="POST"
EXPECTED_CODE="200"
echo -n "Testing '$METHOD $ENDPOINT' | Expecting: $EXPECTED_CODE | Got: "
RESPONSE_CODE=$(curl \
--silent \
--write-out '%{http_code}' \
--output /dev/null \
--request "$METHOD" \
--header "Accept: application/json" \
--header "Content-Type: multipart/form-data" \
--form workflow_params='{"input":{"class":"File","path":"https://github.com/LCSB-BioCore/cwl-example-workflows/blob/master/resources/test.txt"}}' \
--form workflow_type="CWL" \
--form workflow_type_version="v1.0" \
--form workflow_url="https://github.com/LCSB-BioCore/cwl-example-workflows/blob/master/trs.echo/trs-echo.cwl" \
"${WES_ROOT}${ENDPOINT}"
)
echo -n "$RESPONSE_CODE | Result: "
test $RESPONSE_CODE = $EXPECTED_CODE && echo "PASSED" || (echo "FAILED" && exit 1)
# POST /runs 200 with drs object
ENDPOINT="/runs"
METHOD="POST"
EXPECTED_CODE="200"
echo -n "Testing '$METHOD $ENDPOINT' | Expecting: $EXPECTED_CODE | Got: "
RESPONSE_CODE=$(curl \
--silent \
--write-out '%{http_code}' \
--output /dev/null \
--request "$METHOD" \
--header "Accept: application/json" \
--header "Content-Type: multipart/form-data" \
--form workflow_params='{"input":{"class":"File","path":"drs:/iderha-test-central-node.org/8tWCMo"}}' \
--form workflow_type="CWL" \
--form workflow_type_version="v1.0" \
--form workflow_url="https://github.com/LCSB-BioCore/cwl-example-workflows/blob/master/drs.echo/drs-echo.cwl" \
"${WES_ROOT}${ENDPOINT}"
)
echo -n "$RESPONSE_CODE | Result: "
test $RESPONSE_CODE = $EXPECTED_CODE && echo "PASSED" || (echo "FAILED" && exit 1)
# POST /runs 200 with trs tool and drs object
ENDPOINT="/runs"
METHOD="POST"
EXPECTED_CODE="200"
echo -n "Testing '$METHOD $ENDPOINT' | Expecting: $EXPECTED_CODE | Got: "
RESPONSE_CODE=$(curl \
--silent \
--write-out '%{http_code}' \
--output /dev/null \
--request "$METHOD" \
--header "Accept: application/json" \
--header "Content-Type: multipart/form-data" \
--form workflow_params='{"input":{"class":"File","path":"drs://iderha-test-central-node.org/8tWCMo"}}' \
--form workflow_type="CWL" \
--form workflow_type_version="v1.0" \
--form workflow_url="https://github.com/LCSB-BioCore/cwl-example-workflows/blob/master/trs.echo/trs-echo.cwl" \
"${WES_ROOT}${ENDPOINT}"
)
echo -n "$RESPONSE_CODE | Result: "
test $RESPONSE_CODE = $EXPECTED_CODE && echo "PASSED" || (echo "FAILED" && exit 1)