rake task execution: test coverage and refactoring #197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces CI pipeline test coverage for our documented user journey, which will exercise the rake tasks. It also closes #184.
After the first commit, we see the expected failure for #184:
Note that this is a pretty heavy refactoring, where code is being moved
from
exe/tailwindcss
tolib/tailwindcss/commands.rb
where we canmore easily run unit tests on it.
Note also that we no longer use Shellwords to build command strings, a
library which does not generate correct strings on Windows
platforms. Instead we consistently use arrays of command arguments,
which can be passed to
exec
orsystem
however we see fit.The wrapper script conditionally uses
system
on windows platformsbecause
exec
can't find the executable (see related issue atrubys/sprockets-esbuild#4).
Finally, note that the rake tasks no longer use the
exe/tailwindcss
wrapper script, and instead use the binary executable directly. We can
reverse this decision if we ever decide to support manually-installed
tailwindcss somewhere on the $PATH; but because previously the rake
tasks hardcoded the path/to/exe/tailwindcss, we're not introducing any
new constraints by skipping the wrapper.