Skip to content

Commit cdc28fd

Browse files
craig[bot]rail
andcommitted
Merge #143454
143454: urlcheck: skip for pre-release and customized versions r=celiala a=rail Previously, the urllint tool would use the production URLs for alphas and betas. The current SLA is to have the final URLs ready only for the GA version. This commit makes the test skipped for pre-release and customized versions. Release note: none Fixes: #142883 Co-authored-by: Rail Aliiev <[email protected]>
2 parents e88d431 + e2aaee9 commit cdc28fd

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

pkg/build/info.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,8 @@ func TestingOverrideVersion(v string) func() {
225225
func MakeIssueURL(issue int) string {
226226
return fmt.Sprintf("https://go.crdb.dev/issue-v/%d/%s", issue, VersionForURLs())
227227
}
228+
229+
// ParsedVersion returns the parsed version.txt.
230+
func ParsedVersion() *version.Version {
231+
return parsedVersionTxt
232+
}

pkg/testutils/lint/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ go_test(
3535
],
3636
visibility = ["//build/bazelutil:__subpackages__"],
3737
deps = [
38+
"//pkg/build",
3839
"//pkg/build/bazel",
3940
"//pkg/cmd/urlcheck/lib/urlcheck",
4041
"//pkg/internal/codeowners",

pkg/testutils/lint/nightly_lint_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"os/exec"
1414
"testing"
1515

16+
"github.com/cockroachdb/cockroach/pkg/build"
1617
"github.com/cockroachdb/cockroach/pkg/cmd/urlcheck/lib/urlcheck"
1718
sqlparser "github.com/cockroachdb/cockroach/pkg/sql/parser"
1819
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
@@ -24,6 +25,9 @@ func TestNightlyLint(t *testing.T) {
2425
// TestHelpURLs checks that all help texts have a valid documentation URL.
2526
t.Run("TestHelpURLs", func(t *testing.T) {
2627
skip.UnderShort(t)
28+
if build.ParsedVersion().IsPrerelease() || build.ParsedVersion().IsCustomOrNightlyBuild() {
29+
skip.IgnoreLint(t, "pre-release or customized build")
30+
}
2731
if pkgSpecified {
2832
skip.IgnoreLint(t, "PKG specified")
2933
}

0 commit comments

Comments
 (0)