-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Unit testing for setup scripts #7604
Comments
Found an interesting unit testing framework that supports all POSIX shells: https://github.com/kward/shunit2 |
@adamjstewart Is there any progress on this? #9279 would really benefit from some unit tests that I can run against my attempt at |
@JBlaschke: FWIW, we already test some of the shell support in |
@tgamblin Thanks. I've built a
|
We should add unit tests for our setup scripts (
setup-env.sh
andsetup-env.csh
). These tests would serve 2 purposes:setup-env.sh
script work for Bash, Zsh, Ksh, Dash, etc.)setup-env.sh
work the same was assetup-env.csh
, do they work as intended)A lot of PRs introduce new features that seem fine to me, but I don't know whether they work in other shells (#7475). #4048 adds Dash support but no unit tests to see if it works. Other PRs add awesome new features to
setup-env.sh
but forget to add them tosetup-env.csh
(#5955).Recently, we have seen requests for support for other shells like Fish (#7311). It will be important to have a testing script that works regardless of shell before we add a
setup-env.fish
file.Thoughts on where to start? #4048 (comment) recommends ShellCheck for testing POSIX compliance. I would also want a function that tests that it is not only compliant but also works as intended. This should work the same for
setup-env.sh
,setup-env.csh
, andsetup-env.fish
.Another step we can take is to make
lib/spack/env/cc
POSIX compliant. If we replace the shebang with#!/bin/sh
, we could see a significant speed boost on Ubuntu which uses Dash instead of Bash. But of course, this requires unit tests to keep it from breaking.We may also need to consider unit tests for our tab completion scripts (
spack-completion.bash
), especially if we add one for Zsh (#2356).The text was updated successfully, but these errors were encountered: