-
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
Add KillTest e2e #414
Merged
Merged
Add KillTest e2e #414
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
af1f676
Add KillTest e2e test
igalshilman e567078
Add e2e GHA workflow
igalshilman b164ccc
Fix exclusion file path
igalshilman 5e5ed09
Fix dockerfile
igalshilman 693d961
Add an exlusion file
igalshilman 24d82b6
Bump e2e to 1.5
igalshilman 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,123 @@ | ||
name: Integration | ||
|
||
# Controls when the workflow will run | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '0 */6 * * *' # Every 6 hours | ||
workflow_dispatch: | ||
inputs: | ||
restateCommit: | ||
description: 'restate commit' | ||
required: false | ||
default: '' | ||
type: string | ||
restateImage: | ||
description: 'restate image, superseded by restate commit' | ||
required: false | ||
default: 'ghcr.io/restatedev/restate:main' | ||
type: string | ||
workflow_call: | ||
inputs: | ||
restateCommit: | ||
description: 'restate commit' | ||
required: false | ||
default: '' | ||
type: string | ||
restateImage: | ||
description: 'restate image, superseded by restate commit' | ||
required: false | ||
default: 'ghcr.io/restatedev/restate:main' | ||
type: string | ||
|
||
jobs: | ||
|
||
sdk-test-suite: | ||
if: github.repository_owner == 'restatedev' | ||
runs-on: ubuntu-latest | ||
name: "Features integration test (sdk-test-suite version ${{ matrix.sdk-test-suite }})" | ||
strategy: | ||
matrix: | ||
sdk-test-suite: [ "1.4" ] | ||
permissions: | ||
contents: read | ||
issues: read | ||
checks: write | ||
pull-requests: write | ||
actions: read | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: restatedev/sdk-typescript | ||
|
||
### Download the Restate container image, if needed | ||
# Setup restate snapshot if necessary | ||
# Due to https://github.com/actions/upload-artifact/issues/53 | ||
# We must use download-artifact to get artifacts created during *this* workflow run, ie by workflow call | ||
- name: Download restate snapshot from in-progress workflow | ||
if: ${{ inputs.restateCommit != '' && github.event_name != 'workflow_dispatch' }} | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: restate.tar | ||
# In the workflow dispatch case where the artifact was created in a previous run, we can download as normal | ||
- name: Download restate snapshot from completed workflow | ||
if: ${{ inputs.restateCommit != '' && github.event_name == 'workflow_dispatch' }} | ||
uses: dawidd6/action-download-artifact@v3 | ||
with: | ||
repo: restatedev/restate | ||
workflow: ci.yml | ||
commit: ${{ inputs.restateCommit }} | ||
name: restate.tar | ||
- name: Install restate snapshot | ||
if: ${{ inputs.restateCommit != '' }} | ||
run: | | ||
output=$(docker load --input restate.tar) | ||
docker tag "${output#*: }" "localhost/restatedev/restate-commit-download:latest" | ||
docker image ls -a | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Setup sdk-test-suite | ||
run: wget --no-verbose https://github.com/restatedev/sdk-test-suite/releases/download/v${{ matrix.sdk-test-suite }}/restate-sdk-test-suite.jar | ||
|
||
- name: Build Typescript test-services image | ||
id: build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: "packages/restate-e2e-services/Dockerfile" | ||
push: false | ||
load: true | ||
tags: localhost/restatedev/test-services:latest | ||
cache-from: type=gha,scope=${{ github.workflow }} | ||
cache-to: type=gha,mode=max,scope=${{ github.workflow }} | ||
|
||
# Run test suite | ||
- name: Run test suite | ||
env: | ||
RESTATE_CONTAINER_IMAGE: ${{ inputs.restateCommit != '' && 'localhost/restatedev/restate-commit-download:latest' || (inputs.restateImage != '' && inputs.restateImage || 'ghcr.io/restatedev/restate:main') }} | ||
run: java -jar restate-sdk-test-suite.jar run --report-dir=test-report --exclusions-file packages/restate-e2e-services/exclusions.yaml localhost/restatedev/test-services:latest | ||
|
||
# Upload logs and publish test result | ||
- uses: actions/upload-artifact@v4 | ||
if: always() # Make sure this is run even when test fails | ||
with: | ||
name: sdk-typescript-integration-test-report | ||
path: test-report | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: always() | ||
with: | ||
files: | | ||
test-report/*/*.xml |
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 @@ | ||
exclusions: {} |
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,43 @@ | ||
// Copyright (c) 2023 - Restate Software, Inc., Restate GmbH | ||
// | ||
// This file is part of the Restate e2e tests, | ||
// which are released under the MIT license. | ||
// | ||
// You can find a copy of the license in file LICENSE in the root | ||
// directory of this repository or package, or at | ||
// https://github.com/restatedev/e2e/blob/main/LICENSE | ||
|
||
import * as restate from "@restatedev/restate-sdk"; | ||
import { REGISTRY } from "./services.js"; | ||
import type { AwakeableHolder } from "./awakeable_holder.js"; | ||
|
||
const kill = restate.service({ | ||
name: "KillTestRunner", | ||
handlers: { | ||
async startCallTree(ctx: restate.ObjectContext) { | ||
await ctx.objectClient(killSingleton, "").recursiveCall(); | ||
}, | ||
}, | ||
}); | ||
|
||
const killSingleton = restate.object({ | ||
name: "KillTestSingleton", | ||
handlers: { | ||
async recursiveCall(ctx: restate.ObjectContext) { | ||
const { id, promise } = ctx.awakeable(); | ||
ctx | ||
.objectSendClient<AwakeableHolder>({ name: "AwakeableHolder" }, "kill") | ||
.hold(id); | ||
await promise; | ||
|
||
await ctx.objectClient(killSingleton, "").recursiveCall(); | ||
}, | ||
|
||
isUnlocked() { | ||
return Promise.resolve(); | ||
}, | ||
}, | ||
}); | ||
|
||
REGISTRY.addService(kill); | ||
REGISTRY.addObject(killSingleton); |
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.
you can bump to 1.5