Commit 748b098
authored
test: include full coverage for windows (#122)
Instead of launching os specific commands we now launch the os-agnostic
wee dummy `test/wd.clj` script via babashka. It is designed to satisfy
the needs of tests.
Examples of types of changes to launched processes:
- echo hello -> bb script/wd.clj :out hello
- ls -> bb script/wd.clj :ls .
- grep somestring -> bb script/wd.clj :grep somestring
- clojure -e some-expr -> bb script/wd.clj :out boo :err bah :exit 1
Replaced most uses of `cat` with `bb script/wd.clj :upper`, I felt
that transforming the input offered more proof that the process was run
successfully.
Because our wee dummy script allows us to define explicit output and
behaviour, tests assertions are now also often more explicit.
Took care to keep the args syntax the same as the original test.
(i.e. args as string vs vector of strings vs vector of symbols).
CI downloads babashka deps prior to test run. This avoids deps download
messages to stderr interfering with the test. A `bb --version` is sufficient.
Removed Windows specific tests, tests are now OS agnostic:
- windows-invoke-git-with-space-test -> process-space-in-cmd-test
- windows-executable-resolver-test -> tested throughout
- windows-pprint-test -> pprint-test
- windows-pre-start-fn-test -> pre-start-fn-test
Understood that tests can be launched from babashka or babashka/process.
When tests are run from babashka for the jvm, and bb does not exist, we
skip and pass tests that require bb with a warning. These same tests
will be run with natively with bb in a subsequent pass, so we are not
reducing babashka test coverage.
Updated process-dir-option-test:
- No longer skipping a test assertion when run under babashka.
- Deleted a redundant assertion.
Observations when requesting an empty :env noted in README:
- Windows always includes `SystemRoot`
- macOS always includes `__CF_USER_TEXT_ENCODING`
GitHub Actions changes (could be considered out of scope):
- I set fail-fast to false for the matrix, I found it helpful to all
jobs run even after one job had failed.
- I adjusted deps caching to include ~/.deps.clj, I found this helpful
in validating my explorations in what deps I needed to pre-download.
- Noticed bb.edn was missing from deps cache key so added it in.
Made some other very minor changes to code/comments for clarity.
Closes #1161 parent 84919a6 commit 748b098
File tree
6 files changed
+422
-295
lines changed- .circleci
- .github/workflows
- script
- test/babashka
6 files changed
+422
-295
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
44 | 43 | | |
45 | | - | |
46 | | - | |
| 44 | + | |
47 | 45 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
393 | 396 | | |
394 | 397 | | |
395 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments