mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-11 08:31:59 -04:00
* fix(management): treat ci- builds as development for remote jobs CI snapshot builds use a "ci-<sha>" version string that did not match IsDevelopmentVersion, so the remote-jobs minimum-version gate rejected them. Recognize the "ci-" prefix as a development build. * fix(management): treat dev- builds as development for remote jobs Dev snapshot builds use a "dev-<sha>" version string that did not match IsDevelopmentVersion, so the remote-jobs minimum-version gate rejected them. Recognize the "dev-" prefix as a development build, alongside the existing "ci-" prefix.
29 lines
632 B
Go
29 lines
632 B
Go
package version
|
|
|
|
import "testing"
|
|
|
|
func TestIsDevelopmentVersion(t *testing.T) {
|
|
tests := []struct {
|
|
version string
|
|
want bool
|
|
}{
|
|
{"development", true},
|
|
{"development-0823f3ff9ab1", true},
|
|
{"development-0823f3ff9ab1-dirty", true},
|
|
{"ci-7470fbdd", true},
|
|
{"dev-7470fbdd", true},
|
|
{"0.50.0", false},
|
|
{"v0.31.1-dev", false},
|
|
{"1.0.0-dev", false},
|
|
{"dev", false},
|
|
{"", false},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.version, func(t *testing.T) {
|
|
if got := IsDevelopmentVersion(tt.version); got != tt.want {
|
|
t.Errorf("IsDevelopmentVersion(%q) = %v, want %v", tt.version, got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|