Skip to content

Commit 59350a0

Browse files
committed
Remove abao
1 parent 5ebe6d8 commit 59350a0

File tree

10 files changed

+16
-1948
lines changed

10 files changed

+16
-1948
lines changed

Dockerfile

-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ CMD ["unitd", "--control", "*:8080", "--no-daemon", "--log", "/dev/stdout"]
3636
FROM dist as testing
3737

3838
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community mongodb=3.4.4-r0
39-
RUN apk add --no-cache nodejs-npm=6.10.3-r1 \
40-
&& npm install tests/integration_tests/abao
41-
ENV PATH=/src/core/node_modules/.bin:$PATH
4239

4340
RUN pip install -r tests/requirements.txt
4441

TESTING.md

-9
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ All tests are executed by default. Subsets can be run using the filtering option
1313
* To run linting, use `--lint` (`-l`)
1414
* To run unit tests, use `--unit` (`-u`)
1515
* To run integration tests, use `--integ` (`-i`)
16-
* To run abao tests, use `--abao` (`-a`)
1716
* To pass any arguments to `py.test`, use `-- PYTEST_ARGS`
1817

1918
See [py.test usage](https://docs.pytest.org/en/latest/usage.html) for more.
@@ -31,11 +30,3 @@ Without rebuilding the image, run only integration tests matching `foo`, use the
3130
```
3231
./tests/bin/run-tests-docker.sh -B -- -i -- -k foo -vvv --pdb
3332
```
34-
35-
### Tools
36-
- [abao](https://github.com/cybertk/abao/)
37-
38-
### Testing API against RAML with Abao
39-
Abao is one of the testing tools run during our TravisCI build. It tests the API implementation against what’s defined in the RAML spec. Adding a new resource / url to the RAML spec will cause Abao to verify that resource during integration tests. Sometimes abao cannot properly test a resource (file field uploads) or a test may require chaining variable. Abao has before and after hooks for tests, written in javascript. These can be used to skip a test, inject variables into the request, or make extra assertions about the response. See tests/integration/abao in the repo for the hooks file. See [abao github readme](https://github.com/cybertk/abao/blob/master/README.md) for more information on how to use hooks.
40-
41-
Abao tests can depend on specific resources (eg. group, project, session, etc.) pre-existing in the DB. That resource loading should be maintained within `tests/integration_tests/abao/load_fixture.py` and is executed automatically via the integration test scripts at `test/bin`.

tests/bin/run-tests-docker.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ USAGE="
99
Usage:
1010
$0 [OPTION...] [-- TEST_ARGS...]
1111
12-
Build scitran-core image and run tests in a Docker container.
12+
Build scitran/core image and run tests in a Docker container.
13+
Also displays coverage report and saves HTML in htmlcov dir.
1314
1415
Options:
1516
-h, --help Print this help and exit
@@ -20,6 +21,7 @@ Options:
2021
2122
"
2223

24+
2325
main() {
2426
local DOCKER_IMAGE=
2527
local TEST_ARGS=
@@ -82,10 +84,10 @@ main() {
8284
--network core-test \
8385
--volume $(pwd)/api:/src/core/api \
8486
--volume $(pwd)/tests:/src/core/tests \
87+
--env SCITRAN_SITE_API_URL=http://core-test-service/api \
8588
--env SCITRAN_CORE_DRONE_SECRET=$SCITRAN_CORE_DRONE_SECRET \
8689
--env SCITRAN_PERSISTENT_DB_URI=mongodb://core-test-service:27017/scitran \
8790
--env SCITRAN_PERSISTENT_DB_LOG_URI=mongodb://core-test-service:27017/logs \
88-
--env SCITRAN_SITE_API_URL=http://core-test-service/api \
8991
scitran/core:testing \
9092
tests/bin/run-tests-ubuntu.sh $TEST_ARGS
9193
}
@@ -97,6 +99,8 @@ clean_up() {
9799

98100
log "INFO: Test return code = $TEST_RESULT_CODE"
99101
if [ "${TEST_RESULT_CODE}" = "0" ]; then
102+
log "INFO: Collecting coverage..."
103+
100104
# Copy unit test coverage
101105
docker cp core-test-runner:/src/core/.coverage .coverage.unit-tests 2>/dev/null
102106

tests/bin/run-tests-ubuntu.sh

+10-24
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,32 @@ Usage:
1111
1212
Runs linting and all tests if no options are provided.
1313
Runs subset of tests when using the filtering options.
14-
Displays coverage report if all tests ran and passed.
1514
16-
Assumes running in scitran-core container or that core and all of its
17-
dependencies are installed the same way as in the Dockerfile, and that
18-
* TODO scitran-core instance is running at...
19-
* TODO mongodb is runnin at...
15+
Assumes running in a scitran/core:testing container or that core and all
16+
of its dependencies are installed the same way as in the Dockerfile.
2017
2118
Options:
2219
-h, --help Print this help and exit
2320
2421
-l, --lint Run linting
2522
-u, --unit Run unit tests
2623
-i, --integ Run integration tests
27-
-a, --abao Run abao tests
2824
-- PYTEST_ARGS Arguments passed to py.test
2925
26+
Envvars (required for integration tests):
27+
SCITRAN_SITE_API_URL URI to a running core instance (including /api)
28+
SCITRAN_CORE_DRONE_SECRET API shared secret
29+
SCITRAN_PERSISTENT_DB_URI Mongo URI to the scitran DB
30+
SCITRAN_PERSISTENT_DB_LOG_URI Mongo URI to the scitran log DB
31+
3032
"
3133

34+
3235
main() {
3336
export RUN_ALL=true
3437
local RUN_LINT=false
3538
local RUN_UNIT=false
3639
local RUN_INTEG=false
37-
local RUN_ABAO=false
3840
local PYTEST_ARGS=
3941

4042
while [ $# -gt 0 ]; do
@@ -51,10 +53,6 @@ main() {
5153
RUN_ALL=false
5254
RUN_INTEG=true
5355
;;
54-
-a|--abao)
55-
RUN_ALL=false
56-
RUN_ABAO=true
57-
;;
5856
--)
5957
shift
6058
PYTEST_ARGS="$@"
@@ -78,8 +76,7 @@ main() {
7876
RUN_LINT=true
7977
RUN_UNIT=true
8078
RUN_INTEG=true
81-
RUN_ABAO=true
82-
elif ${RUN_LINT} && ${RUN_UNIT} && ${RUN_INTEG} && ${RUN_ABAO}; then
79+
elif ${RUN_LINT} && ${RUN_UNIT} && ${RUN_INTEG}; then
8380
# All filtering options were used, the same as none
8481
RUN_ALL=true
8582
fi
@@ -104,17 +101,6 @@ main() {
104101
log "Running integration tests ..."
105102
PYTHONDONTWRITEBYTECODE=1 py.test tests/integration_tests/python $PYTEST_ARGS
106103
fi
107-
108-
if ${RUN_ABAO}; then
109-
log "Running abao tests ..."
110-
# Create resources that Abao relies on
111-
python tests/integration_tests/abao/load_fixture.py
112-
113-
local BASEDIR=$(pwd)
114-
cd raml/schemas/definitions
115-
abao ../../api.raml "--server=$SCITRAN_SITE_API_URL" "--hookfiles=../../../tests/integration_tests/abao/abao_test_hooks.js"
116-
cd $BASEDIR
117-
fi
118104
}
119105

120106

0 commit comments

Comments
 (0)