Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #116
- Loading branch information