Copyright (c) 2019 California Community Colleges Technology Center
Licensed under the MIT license.
A copy of this license may be found at https://opensource.org/licenses/mit-license.php
Postman API Test
This module contains resources for general Postman API Testing
Building
docker build --no-cache -t ccctechcenter/postman-api-test .
Running
Examples of running the tests against other environments include:
College Adaptor
# testing vs a locally-running mock adaptor. NOTE: the addition of the `--net="host"` directive is required for the test container to correctly resolve the "localhost" endpoint
docker run --net="host" --rm -v $PWD:/etc/newman/newman -t ccctechcenter/postman-api-test environment=001-dev basename=CollegeAdaptor_build-tests folder="mock-adaptor-tests"
# testing vs the 002 CI mock adaptor
docker run --rm -v $PWD:/etc/newman/newman -t ccctechcenter/postman-api-test environment=002-ci basename=CollegeAdaptor_build-tests folder="mock-adaptor-tests"
# testing vs the 001 QA mock adaptor
docker run --rm -v $PWD:/etc/newman/newman -t ccctechcenter/postman-api-test environment=001-qa basename=CollegeAdaptor_build-tests folder="mock-adaptor-tests"
# testing vs 051-qa adaptor, Peoplesoft Transcripts feature:
docker run --rm -v $PWD:/etc/newman/newman -t ccctechcenter/postman-api-test environment=051-qa basename=CollegeAdaptor_sites folder="Peoplesoft Transcripts"
Keycloak
# testing vs a locally-running keycloak. NOTE: the addition of the `--net="host"` directive is required for the test container to correctly resolve the "localhost" endpoint
docker run --net="host" --rm -v $PWD:/etc/newman/newman -t registry.ccctechcenter.org/ccctechcenter/postman-api-test environment=dev basename=Keycloak folder="realm-tests"
docker run --rm -v $PWD:/etc/newman/newman -t registry.ccctechcenter.org/ccctechcenter/postman-api-test environment=ci basename=Keycloak folder="realm-tests"
# testing vs the CI Keycloak instance
docker run --rm -v $PWD:/etc/newman/newman -t ccctechcenter/postman-api-test environment=ci basename=Keycloak folder="realm-tests"
API Gateway
# Run full set of tests in API Gateway collection in CI
docker run --net="host" --rm -v $PWD:/etc/newman/newman -t registry.ccctechcenter.org/ccctechcenter/postman-api-test environment=ci basename="API-Gateway"
Cloud Config Server
# Run full set of tests for Cloud Config server against local docker instance
docker run --net="host" --rm -v $PWD:/etc/newman/newman -t ccctechcenter/postman-api-test environment=dev basename="Cloud-Config-Server"
# test against CI
docker run --net="host" --rm -v $PWD:/etc/newman/newman -t ccctechcenter/postman-api-test environment=ci basename="Cloud-Config-Server"
Stopping
With the above docker-compose command, you can CTRL-C to stop the processes.