Closed willmurphyscode closed 5 months ago
@anchore/tools what do you all think about the approach here, before I spend a bunch more time going further in this direction. Namely:
if runtime.GOOS == "windows" { t.Skip( <some reason >) }
is an ok intermediate state to be in? I'd like to get CI running Windows unit tests soon, with a small, known set of skipped tests that we can work on.got = strings.Replace(got, string(os.PathSeparator), "/")
before test assertions is reasonable? Basically then the test want
is written with unix-style paths, and we just do a replace before comparison?If we think this is reasonable, I'll take approaches like these forward until we can turn on unit tests in CI for binny, but there will be a lot more work like this, so I wanted input on the direction before doing that, in case someone has a better idea or an objection to one of these approaches.
This is a step towards supporting windows (see #17).
The main goal of this branch is to make the Taskfile stop depending on shell core utils to define variables, for example
go list ./... | grep -v {{ .OWNER }}/{{ .PROJECT }}/test | tr '\n' ' '
will fail on Windows becausegrep
andtr
are not guaranteed to be on PATH.Since Python will be available, this branch experiments with python, either in separate files or inline, to perform this work. Requiring Python as a dev dependency seems reasonable, since Python is very widely used. The other choice is maintaining parallel sets of commands in
sh
andpowershell
, but I think contributors are much more likely to be comfortable in Python than powershell. In other words, requiring contributors to install Python seems less onerous than requiring them to learn powershell. Additionally, I've done some experiments in powershell, and a lot of things that are very quick one-liners in sh, (e.g.<something> | grep -v <something-else>
ortest -f <some-file>
) are pretty lengthy powershell invocations.