Container with tools for running Postman scripts for integration tests on local or CI environments
6.7K
This container can be extended for running Postman requests and validations for creating integration tests in CI environments.
Instead of using other API test methods, by using Postman collections, you can use the same script you use during development to be run on the server during CI executions.
This container exposes some APIs for executing and verifying Postman collection scripts. Extend this container, add your Postman script to /provisioning/collection.json, build the container and start it up!
See a full example at /example
Create a new directory for the new container
Create a Postman collection with all the tests and verifications you wish to perform when running this container on the server
Create the Postman collection, right click on it and export contents to /provisioning/collection.json
Take a look at https://learning.getpostman.com/docs/postman/scripts/test_scripts/ for more details
Create Dockerfile
FROM flaviostutz/postman-runner
ADD /provisioning /provisioning
version: '3.5'
services:
my-tests:
build: .
ports:
- 2000:2000
environment:
- LOG_LEVEL=debug
- RUN_ON_STARTUP=true
Run "docker-compose up --build"
Check test results at container logs
Open http://localhost:2000/results to see complete results
Run POST "/test" to trigger a new test execution
RUN_ON_STARTUP - whetever to run Postman scripts during container startup. defaults to false
RUN_API_SERVER - whetever to run a REST API server for accepting requests like GET /results, POST /test etc. defaults to true. Set this to false if you wish the container to run, launch test scripts and exit with zero exit code if tests PASSED and not zero if FAILED.
WAIT_CONNECT_HOST + WAIT_CONNECT_PORT- wait for a successful tcp connection to host:port before starting tests
WAIT_TIME_SECONDS - time to wait before launching tests (after tcp connect, if defined)
All ENVs set to your container will be used to replace references in files /provisioning/environment.json and /provisioning/collection.json
POST /test
GET /status
GET /results
GET /results/json
GET /results/json-summary
GET /results/junit
Content type
Image
Digest
Size
413.6 MB
Last updated
over 6 years ago
docker pull flaviostutz/postman-runner