You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/09/23 09:05:22 UTC
[GitHub] [camel-quarkus] aldettinger opened a new pull request #3126: aws2-lambda: Add alias tests #2749
aldettinger opened a new pull request #3126:
URL: https://github.com/apache/camel-quarkus/pull/3126
<!-- Uncomment and fill this section if your PR is not trivial
[ ] An issue should be filed for the change unless this is a trivial change (fixing a typo or similar). One issue should ideally be fixed by not more than one commit and the other way round, each commit should fix just one issue, without pulling in other changes.
[ ] Each commit in the pull request should have a meaningful and properly spelled subject line and body. Copying the title of the associated issue is typically enough. Please include the issue number in the commit message prefixed by #.
[ ] The pull request description should explain what the pull request does, how, and why. If the info is available in the associated issue or some other external document, a link is enough.
[ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close the named issue upon merging the pull request. Using them is typically a good idea.
[ ] Please run mvn process-resources -Pformat (and amend the changes if necessary) before sending the pull request.
[ ] Contributor guide is your good friend: https://camel.apache.org/camel-quarkus/latest/contributor-guide.html
-->
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #3126: aws2-lambda: Add alias tests #2749
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #3126:
URL: https://github.com/apache/camel-quarkus/pull/3126#discussion_r714606716
##########
File path: integration-test-groups/aws2/aws2-lambda/src/test/java/org/apache/camel/quarkus/component/aws2/lambda/it/Aws2LambdaTest.java
##########
@@ -42,43 +45,50 @@
@Test
public void performingOperationsOnLambdaFunctionShouldSucceed() {
final String functionName = "cqFunction" + java.util.UUID.randomUUID().toString().replace("-", "");
- final String name = "Joe " + java.util.UUID.randomUUID().toString().replace("-", "");
- /* The role is not created immediately, so we need to retry */
- Awaitility.await()
- .pollDelay(6, TimeUnit.SECONDS) // never succeeded earlier than 6 seconds after creating the role
+ // The required role to create a function is not created immediately, so we need to retry
+ await().pollDelay(6, TimeUnit.SECONDS) // never succeeded earlier than 6 seconds after creating the role
.pollInterval(1, TimeUnit.SECONDS)
.atMost(120, TimeUnit.SECONDS)
- .until(
- () -> {
- ExtractableResponse<?> response = RestAssured.given()
- .contentType("application/zip")
- .body(createInitialLambdaFunctionZip())
- .post("/aws2-lambda/function/create/" + functionName)
- .then()
- .extract();
- switch (response.statusCode()) {
- case 201:
- LOG.infof("Lambda function %s created", functionName);
- return true;
- case 400:
- LOG.infof("Could not create Lambda function %s yet (will retry): %d %s", functionName,
- response.statusCode(),
- response.body().asString());
- return false;
- default:
- throw new RuntimeException(
- "Unexpected status from /aws2-lambda/function/create " + response.statusCode() + " "
- + response.body().asString());
- }
- });
+ .until(() -> {
+ ExtractableResponse<?> response = RestAssured.given()
+ .contentType("application/zip")
+ .body(createInitialLambdaFunctionZip())
+ .post("/aws2-lambda/function/create/" + functionName)
+ .then()
+ .extract();
+ switch (response.statusCode()) {
+ case 201:
+ LOG.infof("Lambda function %s created", functionName);
+ return true;
+ case 400:
+ LOG.infof("Could not create Lambda function %s yet (will retry): %d %s", functionName,
+ response.statusCode(), response.body().asString());
+ return false;
+ default:
+ throw new RuntimeException("Unexpected status from /aws2-lambda/function/create "
+ + response.statusCode() + " " + response.body().asString());
+ }
+ });
+
Review comment:
The idea is to keep function creation/deletion at this level. And push other functions/alias tests in sub-methods.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #3126: aws2-lambda: Add alias tests #2749
Posted by GitBox <gi...@apache.org>.
aldettinger commented on a change in pull request #3126:
URL: https://github.com/apache/camel-quarkus/pull/3126#discussion_r714606716
##########
File path: integration-test-groups/aws2/aws2-lambda/src/test/java/org/apache/camel/quarkus/component/aws2/lambda/it/Aws2LambdaTest.java
##########
@@ -42,43 +45,50 @@
@Test
public void performingOperationsOnLambdaFunctionShouldSucceed() {
final String functionName = "cqFunction" + java.util.UUID.randomUUID().toString().replace("-", "");
- final String name = "Joe " + java.util.UUID.randomUUID().toString().replace("-", "");
- /* The role is not created immediately, so we need to retry */
- Awaitility.await()
- .pollDelay(6, TimeUnit.SECONDS) // never succeeded earlier than 6 seconds after creating the role
+ // The required role to create a function is not created immediately, so we need to retry
+ await().pollDelay(6, TimeUnit.SECONDS) // never succeeded earlier than 6 seconds after creating the role
.pollInterval(1, TimeUnit.SECONDS)
.atMost(120, TimeUnit.SECONDS)
- .until(
- () -> {
- ExtractableResponse<?> response = RestAssured.given()
- .contentType("application/zip")
- .body(createInitialLambdaFunctionZip())
- .post("/aws2-lambda/function/create/" + functionName)
- .then()
- .extract();
- switch (response.statusCode()) {
- case 201:
- LOG.infof("Lambda function %s created", functionName);
- return true;
- case 400:
- LOG.infof("Could not create Lambda function %s yet (will retry): %d %s", functionName,
- response.statusCode(),
- response.body().asString());
- return false;
- default:
- throw new RuntimeException(
- "Unexpected status from /aws2-lambda/function/create " + response.statusCode() + " "
- + response.body().asString());
- }
- });
+ .until(() -> {
+ ExtractableResponse<?> response = RestAssured.given()
+ .contentType("application/zip")
+ .body(createInitialLambdaFunctionZip())
+ .post("/aws2-lambda/function/create/" + functionName)
+ .then()
+ .extract();
+ switch (response.statusCode()) {
+ case 201:
+ LOG.infof("Lambda function %s created", functionName);
+ return true;
+ case 400:
+ LOG.infof("Could not create Lambda function %s yet (will retry): %d %s", functionName,
+ response.statusCode(), response.body().asString());
+ return false;
+ default:
+ throw new RuntimeException("Unexpected status from /aws2-lambda/function/create "
+ + response.statusCode() + " " + response.body().asString());
+ }
+ });
+
Review comment:
The idea is to keep lambda function creation/deletion at this level. And push other functions/alias tests in sub-methods.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] aldettinger merged pull request #3126: aws2-lambda: Add alias tests #2749
Posted by GitBox <gi...@apache.org>.
aldettinger merged pull request #3126:
URL: https://github.com/apache/camel-quarkus/pull/3126
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org