generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: GHA to smoke test against last released exemplar #2983
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
16b1ec5
chore: WIP smoke test upgrade path
safeer adf7840
retrieve latest tagged release
safeer 612bb22
go test smoketest
safeer e687129
add placeholder smoketest module
safeer 4c47a82
upload smoke-test-upgrade report artifact
safeer 5d4d7d8
logging and handling to find script error
safeer b358e5d
run previous exemplar on current HEAD
safeer ff6d1ec
debug: run smoketests on previous commit
safeer bd51019
use envar to conditionally run smoke test with kube
safeer c452484
checkout exemplar from previous commit instead of whole tree
safeer e56f7ee
replace currente exemplar with latest release's exemplar
safeer ca65d1f
test against previous release, remove tmp smoke test
safeer 14ff58c
cleanup
safeer e42c376
more apt GHA name since it doesn't test the user upgrade path
safeer dd2e7a7
add smoketest workflow which checks out the tagged release and fetche…
safeer 82fdc33
run tagged release cluster with released binaries
safeer 6bee6b4
deploy tagged dockerhub image to kube cluster, run smoke test without…
safeer 9f62860
use deployment Justfile from HEAD
safeer 634b79b
checkout HEAD and run smoke test with kube deploy to test upgrade path
safeer 41ccb05
remove gate on java builds, enable exemplar test
safeer c097c5d
simple java module to debug test timeout issue
safeer cf4e664
fix deploy-version version to match helm chart usage
safeer 98e1b8e
fix: istio
stuartwdouglas f2eed7e
move SKIP_KUBE_FULL_DEPLOY env to harness
safeer 11eb372
ingress now working, FSMNext is broken
safeer 62e7d94
fix tests
safeer ad37c58
chore(autofmt): Automated formatting
github-actions[bot] 2bb92a5
adjust ingress path
stuartwdouglas 0f8d4fe
update workflow to run smoketest
safeer dd45516
enable smoketest for pushes to main
safeer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
name: SmokeTest | ||
concurrency: | ||
group: ${{ github.ref }}-smoketest | ||
cancel-in-progress: true | ||
jobs: | ||
smoke-test-upgrade-path: | ||
name: Smoke Test Upgrade Path | ||
if: github.event_name != 'pull_request' || github.event.action == 'enqueued' || contains( github.event.pull_request.labels.*.name, 'run-all') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository with full history | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
- name: Get last tagged release | ||
run: | | ||
latest_release=$(git tag --sort=-v:refname | grep -v v1 | head -n 1) | ||
echo "Latest release: $latest_release" | ||
echo "LATEST_VERSION=${latest_release#v}" >> "$GITHUB_ENV" | ||
- name: Check out the last tagged release | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: v${{ env.LATEST_VERSION }} | ||
fetch-depth: 1 | ||
fetch-tags: true | ||
# The following grabs the current smoke test and deployment Justfile from the HEAD. This | ||
# is to solve the chicken-and-egg. Once it's in the tagged release, skip this. | ||
- name: Check out the current smoke test | ||
uses: actions/checkout@v4 | ||
with: | ||
clean: false | ||
repository: TBD54566975/ftl.git | ||
path: tmpsmoketest | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
sparse-checkout: | | ||
smoketest | ||
deployment | ||
sparse-checkout-cone-mode: false | ||
# When we remove the above step to fetch the current smoke tests and deployment Justfile | ||
# into tmpsmoketest, remove the overwrite step as well. | ||
- name: Replace the tagged release smoketest with the current smoketest | ||
run: | | ||
set -euo pipefail | ||
echo "Replacing tagged release smoketest with current smoketest" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This approach will break if the smoke test adds new features that are in the new version but not the old version, as you are testing the new code again old FTL. This is fine for now but I think but will need some thought going forward. |
||
rm -r ./smoketest && mv ./tmpsmoketest/smoketest ./smoketest | ||
echo "Replacing deployment Justfile with current Justfile" | ||
cp ./tmpsmoketest/deployment/Justfile ./deployment/Justfile | ||
echo "Removing tmpsmoketest" | ||
rm -r ./tmpsmoketest | ||
- name: Init Hermit | ||
uses: cashapp/activate-hermit@v1 | ||
with: | ||
cache: true | ||
- name: Build Cache | ||
uses: ./.github/actions/build-cache | ||
- name: Download Go Modules | ||
run: go mod download | ||
- name: Set up a kube cluster with the tagged release dockerhub image | ||
run: | | ||
set -euo pipefail | ||
echo "Deploying the tagged release to the cluster" | ||
cd deployment && just deploy-version ${{ env.LATEST_VERSION }} && cd .. | ||
# We skip this since it requires an integration test change to skip the full kube deploy. | ||
# Re-enable this step when the tagged release has the integration test change. | ||
# - name: Smoke test the tagged release images | ||
# run: | | ||
# set -euo pipefail | ||
# echo "Running smoke test on the tagged release images" | ||
# USE_DB_CONFIG=true SKIP_KUBE_FULL_DEPLOY=true go test -v -tags smoketest -run '^Test' ./smoketest | ||
- name: Check out HEAD of the current branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 1 | ||
- name: Smoke test HEAD with a full deploy to test upgrade path | ||
run: | | ||
set -euo pipefail | ||
echo "Running smoke test on the HEAD images" | ||
USE_DB_CONFIG=true go test -v -timeout 15m -tags smoketest -run '^Test' ./smoketest | ||
- name: Archive Report | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: kube-report-smoke-test-upgrade | ||
path: /tmp/ftl-kube-report/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// This is the echo module. | ||
package echo | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
) | ||
|
||
// Echo returns a greeting with the current time. | ||
// | ||
//ftl:verb export | ||
func Echo(ctx context.Context, req string) (string, error) { | ||
return fmt.Sprintf("Hello, %s!!!", req), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module = "echo" | ||
language = "go" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module ftl/echo | ||
|
||
go 1.23.0 | ||
|
||
replace github.com/TBD54566975/ftl => ../.. | ||
|
||
require github.com/TBD54566975/ftl v0.0.0-00010101000000-000000000000 | ||
|
||
require ( | ||
github.com/alecthomas/participle/v2 v2.1.1 // indirect | ||
github.com/alecthomas/types v0.16.0 // indirect | ||
github.com/deckarep/golang-set/v2 v2.6.0 // indirect | ||
github.com/hashicorp/cronexpr v1.1.2 // indirect | ||
github.com/swaggest/jsonschema-go v0.3.72 // indirect | ||
github.com/swaggest/refl v1.3.0 // indirect | ||
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect | ||
google.golang.org/protobuf v1.35.1 // indirect | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point (not now) we are going to need to think about testing older releases. The 'latest release' is often just a few commits ago.