Skip to content

Commit 0019d1b

Browse files
committed
rollback double runtime
1 parent 71032db commit 0019d1b

File tree

6 files changed

+47
-15
lines changed

6 files changed

+47
-15
lines changed

.github/workflows/run-e2e-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
e2e:
3333
runs-on: ubuntu-latest
3434
strategy:
35-
max-parallel: 3
35+
max-parallel: 4
3636
matrix:
3737
java: [ 8, 11, 17, 21 ]
3838
name: End-to-end tests java${{ matrix.java }}

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ Powertools for AWS Lambda (Java) is a developer toolkit to implement Serverless
99
1010
**[📜Documentation](https://docs.powertools.aws.dev/lambda-java/)** | **[Feature request](https://github.com/aws-powertools/powertools-lambda-java/issues/new?assignees=&labels=feature-request%2C+triage&template=feature_request.md&title=)** | **[🐛Bug Report](https://github.com/aws-powertools/powertools-lambda-java/issues/new?assignees=&labels=bug%2C+triage&template=bug_report.md&title=)** | **[Detailed blog post](https://aws.amazon.com/blogs/opensource/simplifying-serverless-best-practices-with-aws-lambda-powertools-java/)**
1111

12+
### Java Compatibility
13+
Powertools for AWS Lambda (Java) supports all Java version from 8 up to 21 as well as the
14+
[corresponding Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).
15+
16+
AspectJ does not yet support Java 21 [[1]](https://github.com/eclipse-aspectj/aspectj/issues/260), [[2]](https://github.com/eclipse-aspectj/aspectj/blob/master/docs/dist/doc/JavaVersionCompatibility.md).
17+
If you need to use aspects - either Powertools features leveraging aspects or other libraries - you should use the JDK 17 compiler and target either the Java 17 or Java 21
18+
Lambda runtimes.
19+
1220
### Installation
1321

1422
Powertools for AWS Lambda (Java) is available in Maven Central. You can use your favourite dependency management tool to install it

docs/index.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@ Powertools for AWS Lambda (Java) is a suite of utilities for AWS Lambda Function
1111
Powertools for AWS Lambda is also available for [Python](https://docs.powertools.aws.dev/lambda/python/latest/){target="_blank"}, [TypeScript](https://docs.powertools.aws.dev/lambda/typescript/latest/){target="_blank"}, and [.NET](https://docs.powertools.aws.dev/lambda/dotnet/){target="_blank"}
1212

1313

14-
!!! tip "Looking for a quick run through of the core utilities?"
14+
???+ tip "Looking for a quick run through of the core utilities?"
1515
Check out [this detailed blog post](https://aws.amazon.com/blogs/opensource/simplifying-serverless-best-practices-with-aws-lambda-powertools-java/) with a practical example. To dive deeper,
1616
the [Powertools for AWS Lambda (Java) workshop](https://catalog.us-east-1.prod.workshops.aws/workshops/a7011c82-e4af-4a52-80fa-fcd61f1dacd9/en-US/introduction) is a great next step.
1717

18+
???+ tip "Java Compatability"
19+
Powertools for AWS Lambda (Java) supports all Java version from 8 up to 21 as well as the
20+
[corresponding Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).
21+
22+
AspectJ does not yet support Java 21 [[1]](https://github.com/eclipse-aspectj/aspectj/issues/260), [[2]](https://github.com/eclipse-aspectj/aspectj/blob/master/docs/dist/doc/JavaVersionCompatibility.md).
23+
If you need to use aspects - either Powertools features leveraging aspects or other libraries - you should use the JDK 17 compiler and target either the Java 17 or Java 21
24+
Lambda runtimes.
25+
1826
## Tenets
1927

2028
This project separates core utilities that will be available in other runtimes vs general utilities that might not be available across all runtimes.

pom.xml

+14
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,20 @@
102102
</snapshotRepository>
103103
</distributionManagement>
104104

105+
<repositories>
106+
<repository>
107+
<id>ossrh-snapshots</id>
108+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
109+
<releases>
110+
<enabled>false</enabled>
111+
</releases>
112+
<snapshots>
113+
<enabled>true</enabled>
114+
<updatePolicy>always</updatePolicy>
115+
</snapshots>
116+
</repository>
117+
</repositories>
118+
105119
<dependencyManagement>
106120
<dependencies>
107121
<dependency>

powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/LargeMessageIdempotentE2ET.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public static void tearDown() {
107107
@Test
108108
public void test_ttlNotExpired_doesNotInsertInDDB_ttlExpired_insertInDDB() throws InterruptedException,
109109
IOException {
110-
int waitMs = 10000;
110+
int waitMs = 15000;
111111

112112
// GIVEN
113113
InputStream inputStream = this.getClass().getResourceAsStream("/large_sqs_message.txt");

powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/testutils/Infrastructure.java

+14-12
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ public void destroy() {
204204
private Stack createStackWithLambda() {
205205
boolean createTableForAsyncTests = false;
206206
Stack stack = new Stack(app, stackName);
207+
207208
List<String> packagingInstruction = Arrays.asList(
208209
"/bin/sh",
209210
"-c",
@@ -506,29 +507,30 @@ public static class Builder {
506507
private String ddbStreamsTableName;
507508

508509
private Builder() {
509-
getJavaRuntime();
510+
runtime = mapRuntimeVersion("JAVA_VERSION");
510511
}
511512

512-
/**
513-
* Retrieve the java runtime to use for the lambda function.
514-
*/
515-
private void getJavaRuntime() {
516-
String javaVersion = System.getenv("JAVA_VERSION"); // must be set in GitHub actions
513+
514+
515+
private JavaRuntime mapRuntimeVersion(String environmentVariableName) {
516+
String javaVersion = System.getenv(environmentVariableName); // must be set in GitHub actions
517+
JavaRuntime ret = null;
517518
if (javaVersion == null) {
518-
throw new IllegalArgumentException("JAVA_VERSION is not set");
519+
throw new IllegalArgumentException(environmentVariableName + " is not set");
519520
}
520521
if (javaVersion.startsWith("8")) {
521-
runtime = JavaRuntime.JAVA8AL2;
522+
ret = JavaRuntime.JAVA8AL2;
522523
} else if (javaVersion.startsWith("11")) {
523-
runtime = JavaRuntime.JAVA11;
524+
ret = JavaRuntime.JAVA11;
524525
} else if (javaVersion.startsWith("17")) {
525-
runtime = JavaRuntime.JAVA17;
526+
ret = JavaRuntime.JAVA17;
526527
} else if (javaVersion.startsWith("21")) {
527-
runtime = JavaRuntime.JAVA21;
528+
ret = JavaRuntime.JAVA21;
528529
} else {
529530
throw new IllegalArgumentException("Unsupported Java version " + javaVersion);
530531
}
531-
LOG.debug("Java Version set to {}, using runtime {}", javaVersion, runtime.getRuntime());
532+
LOG.debug("Java Version set to {}, using runtime variable {}", ret, javaVersion);
533+
return ret;
532534
}
533535

534536
public Infrastructure build() {

0 commit comments

Comments
 (0)