jamesnetherton commented on code in PR #8795:
URL: https://github.com/apache/camel-quarkus/pull/8795#discussion_r3480488597
##########
integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestResource.java:
##########
@@ -63,37 +67,47 @@ public Map<String, String> start() {
if (usingMockBackend) {
MockBackendUtils.logMockBackendUsed();
- String localstackLogLevel =
System.getProperty("localstack.log.level",
System.getenv("LOCALSTACK_LOG_LEVEL"));
- if (localstackLogLevel == null) {
- localstackLogLevel = "info";
- }
-
- final String[] services = customizers.stream()
- .map(Aws2TestEnvCustomizer::localstackServices)
- .flatMap(Stream::of)
- .distinct()
- .map(Service::getName)
- .toArray(String[]::new);
-
final Service[] exportCredentialsServices = customizers.stream()
-
.map(Aws2TestEnvCustomizer::exportCredentialsForLocalstackServices)
+
.map(Aws2TestEnvCustomizer::exportCredentialsForMockServices)
.flatMap(Stream::of)
.distinct()
.toArray(Service[]::new);
+ boolean needsDockerSocket = customizers.stream()
+ .map(Aws2TestEnvCustomizer::awsServices)
+ .flatMap(Stream::of)
+ .anyMatch(s -> s == Service.LAMBDA);
+
DockerImageName imageName = DockerImageName
-
.parse(ConfigProvider.getConfig().getValue("localstack.container.image",
String.class))
- .asCompatibleSubstituteFor("localstack/localstack");
- LocalStackContainer localstack = new LocalStackContainer(imageName)
- .withServices(services);
- localstack.withEnv("LS_LOG", localstackLogLevel);
- localstack.withEnv("AWS_ACCESS_KEY_ID", "testAccessKeyId"); //has
to be longer then `test`, to work on FIPS systems
- localstack.withEnv("AWS_SECRET_ACCESS_KEY", "testSecretKeyId");
- localstack.withLogConsumer(new Slf4jLogConsumer(LOG));
- localstack.start();
-
- envContext = new Aws2TestEnvContext(localstack.getAccessKey(),
localstack.getSecretKey(), localstack.getRegion(),
- useDefaultCredentialsProvider, Optional.of(localstack),
exportCredentialsServices);
+
.parse(ConfigProvider.getConfig().getValue("floci.container.image",
String.class));
+
+ GenericContainer<?> floci = new GenericContainer<>(imageName)
+ .withExposedPorts(4566)
+ .waitingFor(Wait.forHttp("/_floci/health").forPort(4566))
+ .withEnv("AWS_ACCESS_KEY_ID", "testAccessKeyId") //has to
be longer then `test`, to work on FIPS systems
+ .withEnv("AWS_SECRET_ACCESS_KEY", "testSecretKeyId")
+ .withLogConsumer(new Slf4jLogConsumer(LOG));
+
+ if (needsDockerSocket) {
+ Path dockerSocket = Path.of("/var/run/docker.sock");
Review Comment:
Yes, naturally it wont exist on Windows. On GitHub container testing is
skipped anyway.
Right now any tests depending on AWS Lamdba would fail if run on Windows.
Would you prefer if the affected tests were skipped instead?
##########
integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestResource.java:
##########
@@ -63,37 +67,47 @@ public Map<String, String> start() {
if (usingMockBackend) {
MockBackendUtils.logMockBackendUsed();
- String localstackLogLevel =
System.getProperty("localstack.log.level",
System.getenv("LOCALSTACK_LOG_LEVEL"));
- if (localstackLogLevel == null) {
- localstackLogLevel = "info";
- }
-
- final String[] services = customizers.stream()
- .map(Aws2TestEnvCustomizer::localstackServices)
- .flatMap(Stream::of)
- .distinct()
- .map(Service::getName)
- .toArray(String[]::new);
-
final Service[] exportCredentialsServices = customizers.stream()
-
.map(Aws2TestEnvCustomizer::exportCredentialsForLocalstackServices)
+
.map(Aws2TestEnvCustomizer::exportCredentialsForMockServices)
.flatMap(Stream::of)
.distinct()
.toArray(Service[]::new);
+ boolean needsDockerSocket = customizers.stream()
+ .map(Aws2TestEnvCustomizer::awsServices)
+ .flatMap(Stream::of)
+ .anyMatch(s -> s == Service.LAMBDA);
+
DockerImageName imageName = DockerImageName
-
.parse(ConfigProvider.getConfig().getValue("localstack.container.image",
String.class))
- .asCompatibleSubstituteFor("localstack/localstack");
- LocalStackContainer localstack = new LocalStackContainer(imageName)
- .withServices(services);
- localstack.withEnv("LS_LOG", localstackLogLevel);
- localstack.withEnv("AWS_ACCESS_KEY_ID", "testAccessKeyId"); //has
to be longer then `test`, to work on FIPS systems
- localstack.withEnv("AWS_SECRET_ACCESS_KEY", "testSecretKeyId");
- localstack.withLogConsumer(new Slf4jLogConsumer(LOG));
- localstack.start();
-
- envContext = new Aws2TestEnvContext(localstack.getAccessKey(),
localstack.getSecretKey(), localstack.getRegion(),
- useDefaultCredentialsProvider, Optional.of(localstack),
exportCredentialsServices);
+
.parse(ConfigProvider.getConfig().getValue("floci.container.image",
String.class));
+
+ GenericContainer<?> floci = new GenericContainer<>(imageName)
+ .withExposedPorts(4566)
+ .waitingFor(Wait.forHttp("/_floci/health").forPort(4566))
+ .withEnv("AWS_ACCESS_KEY_ID", "testAccessKeyId") //has to
be longer then `test`, to work on FIPS systems
+ .withEnv("AWS_SECRET_ACCESS_KEY", "testSecretKeyId")
+ .withLogConsumer(new Slf4jLogConsumer(LOG));
+
+ if (needsDockerSocket) {
+ Path dockerSocket = Path.of("/var/run/docker.sock");
Review Comment:
Yes, naturally it wont exist on Windows. On GitHub, container testing is
skipped anyway.
Right now any tests depending on AWS Lamdba would fail if run on Windows.
Would you prefer if the affected tests were skipped instead?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]