From c5344160ed49bfda75281fba28b5e9ac7b96670e Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Fri, 30 Sep 2022 14:22:57 -0700 Subject: [PATCH] Fix test for release (#790) * changelog for release * update version * update version file * read expected version from file --- cli/azd/test/functional/cli_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/azd/test/functional/cli_test.go b/cli/azd/test/functional/cli_test.go index b750b493dfa..c82275c691e 100644 --- a/cli/azd/test/functional/cli_test.go +++ b/cli/azd/test/functional/cli_test.go @@ -66,8 +66,11 @@ func Test_CLI_Version_PrintsVersion(t *testing.T) { rn := os.Getenv("GITHUB_RUN_NUMBER") if rn != "" { - // TODO: This should be read from cli/version.txt (https://github.com/Azure/azure-dev/issues/36) - require.Contains(t, out, "0.2.0") + runningTestPath := azdcli.GetAzdLocation() + cliPath := strings.Split(runningTestPath, "cli")[0] + version, err := os.ReadFile(path.Join(cliPath, "cli", "version.txt")) + require.NoError(t, err) + require.Contains(t, out, strings.ReplaceAll(string(version), "\n", "")) } else { require.Contains(t, out, fmt.Sprintf("azd version %s", internal.Version)) }