From dd0552581339b4d3c010401a07b26db982beb6a7 Mon Sep 17 00:00:00 2001 From: Pedro Almeida Date: Tue, 1 Sep 2026 18:28:58 +0100 Subject: [PATCH] test: pin func CLI version so config ci workflow test is deterministic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The integration test asserted the generated workflow contains github.DefaultFuncCliVersion, but the command now sources the version from version.Kver (injected via -ldflags). On release-1.23 the branch's latest tag is knative-v1.23.1, so the emitted version did not match the compiled-in default (knative-v1.23.0) and the test failed. Pin version.Kver in the test so the output is independent of the build/branch. Co-Authored-By: Claude Opus 4.8 Signed-off-by: Matej VaĊĦek --- cmd/config_ci_int_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/config_ci_int_test.go b/cmd/config_ci_int_test.go index 1831e51dc5..a9990dd72f 100644 --- a/cmd/config_ci_int_test.go +++ b/cmd/config_ci_int_test.go @@ -18,6 +18,7 @@ import ( "knative.dev/func/pkg/ci/github" fn "knative.dev/func/pkg/functions" fnTest "knative.dev/func/pkg/testing" + "knative.dev/func/pkg/version" ) // START: Integration Tests @@ -77,6 +78,13 @@ func TestNewConfigCICmd_CreatesGitHubWorkflowDirectory(t *testing.T) { } func TestNewConfigCICmd_WritesWorkflowFileToFSWithCorrectYAMLStructure(t *testing.T) { + // Pin the CLI version so the generated workflow is deterministic, + // independent of the version injected via -ldflags at build time + // (which varies with the branch's most recent git tag). + prev := version.Kver + version.Kver = github.DefaultFuncCliVersion + t.Cleanup(func() { version.Kver = prev }) + opts := defaultIntegrationOpts(t, nil) err := runConfigCiCmdIntegration(t, opts)