Skip to content

Commit 79cf9ac

Browse files
authored
Merge pull request #3891 from commercialhaskell/integration-test-docs
Add integration test docs
2 parents 2486133 + adea000 commit 79cf9ac

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/integration/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Stack Integration Tests
2+
3+
This directory contains a bunch of integration tests for Stack. Each
4+
directory inside the `tests` subdirectory represents a single
5+
test. Each of those directories has:
6+
7+
* A `Main.hs` file, which provides the script to be run
8+
* A `files `directory, providing the working directory the script will
9+
be run from. (If you have a test that doesn't require any specific
10+
working directory, there may be no `files` directory.)
11+
12+
It would be great to expand this file into a full tutorial, but for
13+
now, the easiest way to get started with writing an integration test
14+
is to copy an existing example.
15+
16+
## Running
17+
18+
One simple way to run a single test is:
19+
20+
* Change into the `files` directory
21+
* Run the command `stack runghc -- -i../../../lib ../Main.hs`
22+
23+
A more thorough way to run the tests is with
24+
25+
```shell
26+
$ stack test --flag stack:integration-tests stack:test:stack-integration-test
27+
```
28+
29+
Note that this command can take a _long_ time. It's also more thorough
30+
than the quick command given above, as it will run each test with a
31+
clean `STACK_ROOT`.

0 commit comments

Comments
 (0)