Execute your Ghost Inspector tests or suites using CircleCI v2.1
orbs.
Command | Status |
---|---|
ghostinspector/execute-suite |
|
ghostinspector/execute-test |
|
ghostinspector/test-docker-app |
We offer three commands for testing your application using CircleCI orbs and Ghost Inspector:
ghostinspector/execute-suite
- Execute your test suite and optionally wait for the resultsghostinspector/execute-test
- Execute a single test and optionally wait for the resultsghostinspector/test-docker-app
- Execute your test suite against your containerized application
Set up an environment variable in your CircleCI build called GI_API_KEY
. This will be used
automatically by all commands. You may also pass the api-key
parameter explicitly.
Example executing a test suite:
version: 2.1
orbs:
ghostinspector: ghostinspector/[email protected]
jobs:
build:
executor: ghostinspector/default
steps:
- ghostinspector/execute-suite:
id: <my-suite-id>
extra-params: '{"myVar": "foo", "otherVar": "bar"}'
wait: true
Example executing a single test:
version: 2.1
orbs:
ghostinspector: ghostinspector/[email protected]
jobs:
build:
executor: ghostinspector/default
steps:
- ghostinspector/execute-test:
id: <my-test-id>
extra-params: '{"foo": "bar", "other": "var"}'
wait: true
Example executing a test suite against a running Docker container:
version: 2.1
orbs:
ghostinspector: ghostinspector/[email protected]
executors:
docker-executor:
docker:
- image: docker:17.05.0-ce-git
jobs:
build_and_test:
executor: docker-executor
steps:
- setup_remote_docker
- run:
name: Set up temporary docker network
command: docker network create my-docker-network
- run:
name: Start your application container, specifying application port and docker network
command: |
docker run -d \
-e PORT=8080 \
--network my-docker-network \
--name my-app \
my-docker-image
- ghostinspector/test-docker-app:
api-key: <my-ghost-inspector-api-key>
suite-id: <my-ghost-inspector-suite-id>
network: my-docker-network
vpn-token: <my-ngrok-token>
vpn-target: my-docker-image:8080