Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
feat: disable the debug mode in the docker containers
Browse files Browse the repository at this point in the history
  • Loading branch information
clebert committed Apr 22, 2017
1 parent 4b028db commit 5255e9d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
12 changes: 11 additions & 1 deletion README.md
Expand Up @@ -111,7 +111,11 @@ npm install --save-dev tap-mocha-reporter
$(npm bin)/cybernaut | $(npm bin)/tap-mocha-reporter spec
```

*Note: You can set the `DEBUG=cybernaut:*` environment variable to enable debug output.*
To enable debug output, you can set the `DEBUG=cybernaut:*` environment variable:

```sh
DEBUG=cybernaut:* $(npm bin)/cybernaut
```

### [Configuring Cybernaut](#usage)

Expand Down Expand Up @@ -250,6 +254,12 @@ In order to get access to the captured screenshots, a local screenshots director
docker run -ti --rm -v $(cd example/screenshots; pwd):/opt/e2e-test/screenshots -v /dev/shm:/dev/shm clebert/cybernaut-chrome-example
```

To enable debug output, you can set the `DEBUG=cybernaut:*` environment variable:

```sh
docker run -ti --rm -v /dev/shm:/dev/shm -e DEBUG=cybernaut:* clebert/cybernaut-chrome-example
```

*Note: When executing docker run for an image with chrome browser please add `-v /dev/shm:/dev/shm` [volume mount][docker-mount] to use the host's shared memory.
Since a Docker container is not meant to preserve state and spawning a new one takes less than 3 seconds you will likely want to remove containers after each end-to-end test with `--rm` command.*

Expand Down
2 changes: 0 additions & 2 deletions docker/cybernaut-xvfb
Expand Up @@ -19,8 +19,6 @@ export DISPLAY=:99
# https://github.com/SeleniumHQ/docker-selenium/issues/87#issuecomment-187580115
export DBUS_SESSION_BUS_ADDRESS=/dev/null

export DEBUG=cybernaut:*

cybernaut /opt/config.json | tap-mocha-reporter "$2"

# http://stackoverflow.com/a/90435
Expand Down
2 changes: 1 addition & 1 deletion example/docker-run.sh
Expand Up @@ -7,4 +7,4 @@ fi

mkdir -p example/screenshots && \

docker run -ti --rm -v $(cd example/screenshots; pwd):/opt/e2e-test/screenshots -v /dev/shm:/dev/shm "clebert/cybernaut-$1-example"
docker run -ti --rm -v $(cd example/screenshots; pwd):/opt/e2e-test/screenshots -v /dev/shm:/dev/shm -e DEBUG=$DEBUG "clebert/cybernaut-$1-example"
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -76,7 +76,7 @@
"prerelease": "npm run build:sources",
"release": "semantic-release pre && npm publish && semantic-release post",
"pretest": "npm run build:example",
"test": "conventional-changelog-lint --from=HEAD~1 && npm run check && DEBUG=cybernaut:* nyc ava && ./example/docker-run.sh chrome && ./example/docker-run.sh firefox && ./example/docker-run.sh iphone",
"test": "conventional-changelog-lint --from=HEAD~1 && npm run check && export DEBUG=cybernaut:* && nyc ava && ./example/docker-run.sh chrome && ./example/docker-run.sh firefox && ./example/docker-run.sh iphone",
"prewatch": "npm run build:sources",
"watch": "run-p --continue-on-error watch:*",
"watch:sources": "tsc --project . --watch",
Expand Down

0 comments on commit 5255e9d

Please sign in to comment.