You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My original motivation for this PR was that I was working on a different PR, wanted to manually test changes on Windows, and found that task build wouldn't even run. Therefore, this PR follows the "80/20 rule" to deliver the most improvement for the most users for a reasonable amount of effort. In other words, this does not fix every Windows issue in the project, but it does make sure the vast majority of tasks defined in the Taskfiles do now run correctly on both Windows and MacOS.
Changes were tested on MacOS and Windows (given that Linux and MacOS have nearly the same command set, and no commands that actually run on MacOS were changed, so any tasks that ran correctly on Linux before should continue to). See details at the end of this description.
This PR replaces Linux/MacOS-specific commands in Taskfile.yml and cmd/thv-operator/Taskfile.yml with cross-platform templating functions built into go-task (where possible) or platform-specific commands for both *nix and Windows where unavoidable.
Note that the scope of these changes is limited to:
ensuring that the task commands run correctly once dependencies are installed - for example, task test-e2e will fail if ginkgo is not installed (the same is true on MacOS)
ensuring that the task commands run correctly on Windows, not that they necessarily run successfully
ensuring that (nearly) all task commands which run correctly on MacOS also run correctly on Windows - some tasks were found to fail with the same errors on MacOS and Windows, and so were left as is
Example 1: Before this change, on Windows, task test exited without running any tests. After this change, on Windows, task test runs unit tests ... but several of them fail. (This is an opportunity for further Windows improvements.)
Example 2: task operator-test exits with "shell": executable file not found in $PATH on Windows. However, it exits with the same error on MacOS, so this was not addressed as it is outside the scope of making the Taskfiles cross-platform.
Specific Notes / Exceptions:
task lint: Fails with 8 lint issues on Windows
task test: Several failing tests on Windows
task test-e2e: 10 failing specs on Windows
task operator-deploy-local: This is the big exception mentioned above. This looked like it would be a lot of effort, due to the lack of a tail equivalent in Windows, and also is a task that would probably only be used by a small number of fairly advanced developers who would know how to get this to work manually. For now, keeping the 80/20 rule in mind, at least this task is restricted to Linux and MacOS platforms, so rather than just exiting with an error, a user running this test on Windows will get a message that it isn't supported on Windows. Hopefully some advanced Windows / Kubernetes developer will fix this if they run into it.
task operator-test: Exits with "shell": executable file not found in $PATH on Windows, but this is also the case on MacOS
task operator-e2e-test: 1 test fails on Windows, but this is also the case on MacOS
task crdref-gen: This task wasn't working on either Windows or MacOS, due to incorrect config file paths. This has now been fixed. looks like this is intended for CI, rather than local development, given that it's now failing there. Reverting.
Closes#1217.
Signed-off-by: Chris Gernon <[email protected]>
Co-authored-by: Don Browne <[email protected]>
0 commit comments