Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include more detailed Headless Testing section #81

Merged
merged 1 commit into from
Nov 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,33 @@ $ browserify test.js | tape-run --render="tap-spec"

```

## Headless testing / Travis
## Headless testing

To use tape-run with travis, we recommend using the default electron browser, which however requires you to add this part to your travis.yml:
In environments without a screen, you can use `Xvfb` to simulate one. We recommend using the default electron browser,
which however requires you to add additional parts to your headless configurations.

### GitHub Actions

This is a full example to run `npm test`. Refer to the last 2 lines in the YAML config:

```yml
on:
- pull_request
- push

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: npm install
- run: sudo apt-get install xvfb
- run: xvfb-run --auto-servernum npm test
```

### Travis

Add this to your travis.yml:

```yml
addons:
Expand All @@ -175,9 +199,9 @@ install:
- npm install
```

[Source](https://github.com/rhysd/Shiba/blob/055a11a0a2b4f727577fe61371a88d8db9277de5/.travis.yml).
[Full example](https://github.com/rhysd/Shiba/blob/055a11a0a2b4f727577fe61371a88d8db9277de5/.travis.yml).

For gnu/linux installations without a graphical environment:
### Any gnu/linux box

```bash
$ sudo apt-get install xvfb # or equivalent
Expand All @@ -186,7 +210,9 @@ $ Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
$ browser-run ...
```

There is also an example docker machine [here](https://github.com/fraserxu/docker-tape-run).
### Docker

There is also an example [Docker image](https://hub.docker.com/r/kipparker/docker-tape-run). [Source](https://github.com/fraserxu/docker-tape-run)

## Installation

Expand Down