From ff8ca55efef8806daa3b51472a91e20470bface2 Mon Sep 17 00:00:00 2001 From: Safeer Jiwan Date: Fri, 4 Oct 2024 12:12:54 -0700 Subject: [PATCH] run previous exemplar on current HEAD --- .github/workflows/ci.yml | 10 +++++++--- smoketest/exemplar_smoke_test.go | 7 +++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa9b802f8a..5973865a39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -379,16 +379,20 @@ jobs: fetch-depth: 0 fetch-tags: true - name: Get latest release tag + # TODO switch to: latest_release=$(git tag --sort=-v:refname | grep -v v1 | head -n 1) run: | - latest_release=$(git tag --sort=-v:refname | grep -v v1 | head -n 1) + latest_release=$(git rev-parse HEAD^) echo "Latest release: $latest_release" echo "LATEST_RELEASE=$latest_release" >> "$GITHUB_ENV" - - name: Checkout previous code + - name: Check out exemplar from previous release uses: actions/checkout@v4 with: + repository: TBD54566975/ftl.git ref: ${{ env.LATEST_RELEASE }} - fetch-depth: 0 + fetch-depth: 1 fetch-tags: true + sparse-checkout: smoketest + sparse-checkout-cone-mode: false - name: Init Hermit uses: cashapp/activate-hermit@v1 with: diff --git a/smoketest/exemplar_smoke_test.go b/smoketest/exemplar_smoke_test.go index 7820efa751..6b9a1d02fc 100644 --- a/smoketest/exemplar_smoke_test.go +++ b/smoketest/exemplar_smoke_test.go @@ -3,6 +3,7 @@ package smoketest import ( + "fmt" "testing" "github.com/alecthomas/assert/v2" @@ -16,8 +17,10 @@ func TestSmokeEcho(t *testing.T) { in.WithTestDataDir("."), in.CopyModule("echo"), in.Deploy("echo"), - in.Call("echo", "echo", "Bob", func(t testing.TB, response string) { - assert.Equal(t, "Hello, Bob!!!", response) + in.Call("echo", "echo", "Joe", func(t testing.TB, response string) { + name := "Joe" + fmt.Printf("name: %s\n", name) + assert.Equal(t, "Hello, %s!!!", name, response) }), in.Exec("ftl", "--version"), )