Skip to content

Commit d745321

Browse files
SilanHehsilan
andauthored
Chore/fix e2e (#102)
* chore: add parameter to CloyudBasedIntegrationTest for functionNameSuffix * chore: enable e2e test workflow in current branch * Revert "chore: enable e2e test workflow in current branch" This reverts commit f55b2ff. * chore: remove unused import * chore: testSimpleInvokeExample takes name input so it can find the correct durable function to invoke * chore:ran mvn spotless:apply --------- Co-authored-by: hsilan <hsilan@amazon.com>
1 parent ba5a087 commit d745321

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

.github/workflows/e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ jobs:
7373
- name: Build locally
7474
run: mvn -B -q -Dmaven.test.skip=true install --file pom.xml
7575
- name: Cloud Based Integration Tests
76-
run: mvn clean test -B -Dtest.cloud.enabled=true -Dtest=CloudBasedIntegrationTest
76+
run: mvn clean test -B -Dtest.cloud.enabled=true -Dtest=CloudBasedIntegrationTest -Dtest.function.name.suffix='-java${{ matrix.java }}'
7777
working-directory: ./examples

examples/src/main/java/com/amazonaws/lambda/durable/examples/SimpleInvokeExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ public String handleRequest(GreetingRequest input, DurableContext context) {
1818
// invoke `simple-step-example` function
1919
var future = context.invokeAsync(
2020
"call-greeting1",
21-
"simple-step-example:$LATEST",
21+
"simple-step-example" + input.getName() + ":$LATEST",
2222
input,
2323
String.class,
2424
InvokeConfig.builder().build());
2525
var result2 = context.invoke(
2626
"call-greeting2",
27-
"simple-step-example:$LATEST",
27+
"simple-step-example" + input.getName() + ":$LATEST",
2828
input,
2929
String.class,
3030
InvokeConfig.builder().build());

examples/src/test/java/com/amazonaws/lambda/durable/examples/CloudBasedIntegrationTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class CloudBasedIntegrationTest {
2121

2222
private static String account;
2323
private static String region;
24+
private static String functionNameSuffix;
2425

2526
static boolean isEnabled() {
2627
var enabled = "true".equals(System.getProperty("test.cloud.enabled"));
@@ -40,6 +41,7 @@ static void setup() {
4041

4142
account = System.getProperty("test.aws.account");
4243
region = System.getProperty("test.aws.region");
44+
functionNameSuffix = System.getProperty("test.function.name.suffix", "");
4345

4446
if (account == null || region == null) {
4547
var sts = StsClient.create();
@@ -52,7 +54,8 @@ static void setup() {
5254
}
5355

5456
private static String arn(String functionName) {
55-
return "arn:aws:lambda:" + region + ":" + account + ":function:" + functionName + ":$LATEST";
57+
return "arn:aws:lambda:" + region + ":" + account + ":function:" + functionName + functionNameSuffix
58+
+ ":$LATEST";
5659
}
5760

5861
@Test
@@ -71,7 +74,7 @@ void testSimpleStepExample() {
7174
@Test
7275
void testSimpleInvokeExample() {
7376
var runner = CloudDurableTestRunner.create(arn("simple-invoke-example"), Map.class, String.class);
74-
var result = runner.run(Map.of("message", "test"));
77+
var result = runner.run(Map.of("name", functionNameSuffix));
7578

7679
assertEquals(ExecutionStatus.SUCCEEDED, result.getStatus());
7780
assertNotNull(result.getResult(String.class));

0 commit comments

Comments
 (0)