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 2020/09/11 09:41:12 UTC

[GitHub] [camel-quarkus] ppalaga opened a new pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

ppalaga opened a new pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782


   … CAMEL_QUARKUS_START_MOCK_BACKEND=false #1717
   
   @llowinge this is an idea how we could do that. Done only for Telegram, but other tests could use the same pattern with the same env var `CAMEL_QUARKUS_START_MOCK_BACKEND`, so that you can set it once for all tests. WDYT?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga edited a comment on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
ppalaga edited a comment on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-691132555


   > Would community accept the `CAMEL_QUARKUS_START_MOCK_BACKEND` be set by default to `false`
   
   I discussed this with @jamesnetherton  and @oscerd and we prefer not to do that, because it would require all devs to export CAMEL_QUARKUS_START_MOCK_BACKEND=true
   
   @jamesnetherton came with an alternative proposal that is implemented in 7042574
   
   With this solution in place, you can do the following:
   
   * Run the tests with CAMEL_QUARKUS_START_MOCK_BACKEND=false
   * Count the occurrences of `<artifactId>camel-quarkus-integration-test-support-mock-backend</artifactId>` in `integration-tests/*/pom.xml`
   * Count the occurrences of `Real backend will be used for` in the output of all tests
   * The numbers should be non-null and equal (as long as you only run the JVM tests)
   * There should also be zero occurrences of `Mock backend will be used for` in the output of the tests
   
   WDYT?
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] llowinge commented on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
llowinge commented on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-691062491






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga edited a comment on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
ppalaga edited a comment on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-691132555






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] llowinge commented on a change in pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
llowinge commented on a change in pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#discussion_r487917410



##########
File path: integration-tests/telegram/src/main/java/org/apache/camel/quarkus/component/telegram/it/TelegramRoutes.java
##########
@@ -21,37 +21,86 @@
 import java.io.InputStream;
 import java.util.stream.Stream;
 
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+import javax.inject.Named;
+
+import io.quarkus.arc.Unremovable;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.telegram.TelegramComponent;
+import org.apache.camel.quarkus.test.mock.backend.MockBackendUtils;
 import org.apache.camel.support.ResourceHelper;
 import org.apache.camel.util.IOHelper;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
 
+@ApplicationScoped
 public class TelegramRoutes extends RouteBuilder {
 
+    @ConfigProperty(name = "camel.quarkus.start-mock-backend", defaultValue = "true")
+    boolean startMockBackend;

Review comment:
       I'm just thinking if it would be somehow possible to move this parameter into `MockBackendUtils` and there would be the logic with one generic method `logBackendUsed`. Wdyt @jamesnetherton ?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] llowinge commented on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
llowinge commented on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-691062491


   @ppalaga I like the idea with possible switching between mock/external service. Would community accept the `CAMEL_QUARKUS_START_MOCK_BACKEND`  be set by default to `false` and in your tests would be switched to `true` ? In this manner we QE can be safe that the tests will really be run against external service even if property name `CAMEL_QUARKUS_START_MOCK_BACKEND` will change in future.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga edited a comment on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
ppalaga edited a comment on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-691132555






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga closed pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
ppalaga closed pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga commented on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
ppalaga commented on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-698231312


   Superceded by https://github.com/apache/camel-quarkus/pull/1818


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] llowinge edited a comment on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
llowinge edited a comment on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-691062491






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] llowinge edited a comment on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
llowinge edited a comment on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-691062491


   @ppalaga I like the idea with possible switching between mock/external service. Would community accept the `CAMEL_QUARKUS_START_MOCK_BACKEND`  be set by default to `false` and in your tests would be switched to `true` ? In this manner the interested parties can be safe that the tests will really be run against external service even if property name `CAMEL_QUARKUS_START_MOCK_BACKEND` will change in future.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga commented on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
ppalaga commented on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-690993500


   c31201e fixed the formatting


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga commented on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
ppalaga commented on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-690993500






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga closed pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
ppalaga closed pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] llowinge commented on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
llowinge commented on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-691062491






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga edited a comment on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
ppalaga edited a comment on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-691132555


   > Would community accept the `CAMEL_QUARKUS_START_MOCK_BACKEND` be set by default to `false`
   
   I discussed this with @jamesnetherton  and @oscerd and we prefer not to do that, because it would require all devs to export CAMEL_QUARKUS_START_MOCK_BACKEND=true
   
   @jamesnetherton came with an alternative proposal that is implemented in 7042574
   
   With this solution in place, you can do the following:
   
   * Run the tests with CAMEL_QUARKUS_START_MOCK_BACKEND=false
   * Count the occurrences of `<artifactId>camel-quarkus-integration-test-support-mock-backend</artifactId>` in `integration-tests/*/pom.xml`
   * Count the occurrences of `Real backend will be used for` in the output of all tests
   * The numbers should be non-null and equal (as long as you only run the JVM tests)
   * There should also be zero occurrences of `Mock backend will be used for` in the output of the tests
   
   WDYT?
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga commented on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
ppalaga commented on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-691132555


   > Would community accept the `CAMEL_QUARKUS_START_MOCK_BACKEND` be set by default to `false`
   
   I discussed this with @jamesnetherton  and @oscerd and we prefer not to do that, because it would require all devs to export CAMEL_QUARKUS_START_MOCK_BACKEND=true
   
   @jamesnetherton came with an alternative proposal that is implemented in 7042574
   
   With this solution in place, you can do the following:
   
   * Run the tests with CAMEL_QUARKUS_START_MOCK_BACKEND=false
   * Count the occurrences of `<artifactId>camel-quarkus-integration-test-support-mock-backend</artifactId>` in `integration-tests/*/pom.xml`
   * Count the occurrences of `Real backend will be used for` in the output of all tests
   * The numbers should be non-null and equal (as long as you only run the JVM tests)
   
   WDYT?
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga commented on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
ppalaga commented on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-690993500






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga commented on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
ppalaga commented on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-698231312


   Superceded by https://github.com/apache/camel-quarkus/pull/1818


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] llowinge edited a comment on pull request #1782: Make sure that Telegram tests are not run against mock API by setting…

Posted by GitBox <gi...@apache.org>.
llowinge edited a comment on pull request #1782:
URL: https://github.com/apache/camel-quarkus/pull/1782#issuecomment-691062491






----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org