I am using the strategy described here to run the standalone karate.jar along with a custom jar (implementing a LogModifier):
java -cp karate.jar:seesaw-karate.jar:./tests/java com.intuit.karate.Main ./tests/api
This works great on my local machine, but seeing weird behavior when running on AWS CodeBuild: tests report as passing, but take 0 seconds and show no output, indicating they are not actually running.
The CodeBuild job is running on openjdk11 on a /aws/codebuild/standard:3.0 image.
java -version
reports:
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
For comparison my local env:
java version "12.0.2" 2019-07-16
Java(TM) SE Runtime Environment (build 12.0.2+10)
Java HotSpot(TM) 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)
Note: we were previously running with java -jar karate.jar
and that worked successfully in the same CodeBuild environment. My understanding is we need to do the classpath method to include multiple jar files (which we need to do to use a LogModifier). Please correct me if there's a better way!
Here are some logs from the container:
[Container] 2021/03/10 01:31:46 Running command java -Dkarate.config.dir=$RELOADED_DIR/exp/ss2_gql/tests/api/config -Dss2GqlUri=$RELOADED_HTTP_URL -DwsUri=$RELOADED_WS_URL -cp "${RELOADED_DIR}/exp/ss2_gql/karate.jar:${RELOADED_DIR}/exp/ss2_gql/seesaw-karate.jar:${RELOADED_DIR}/exp/ss2_gql/tests/java" com.intuit.karate.Main $RELOADED_DIR/exp/ss2_gql/tests/api --tags ~@ignore -o .karate-output
01:31:50.265 [main] INFO com.intuit.karate.Main - Karate version: 0.9.6
Warning: Nashorn engine is planned to be removed from a future JDK release
01:31:51.993 [main] INFO com.intuit.karate.Runner - waiting for parallel features to complete ...
01:31:52.741 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<pass>> feature 1 of 25: 01/exp/ss2_gql/tests/api/conversation_test.feature
---------------------------------------------------------
feature: 01/exp/ss2_gql/tests/api/conversation_test.feature
report: .karate-output/surefire-reports/01.exp.ss2_gql.tests.api.conversation_test.json
scenarios: 9 | passed: 9 | failed: 0 | time: 0.0000
---------------------------------------------------------
01:31:52.752 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<pass>> feature 2 of 25: 01/exp/ss2_gql/tests/api/migrate_conversation_test.feature
---------------------------------------------------------
feature: 01/exp/ss2_gql/tests/api/migrate_conversation_test.feature
report: .karate-output/surefire-reports/01.exp.ss2_gql.tests.api.migrate_conversation_test.json
scenarios: 1 | passed: 1 | failed: 0 | time: 0.0000
---------------------------------------------------------
01:31:52.761 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<pass>> feature 3 of 25: 01/exp/ss2_gql/tests/api/conv_search.feature
---------------------------------------------------------
feature: 01/exp/ss2_gql/tests/api/conv_search.feature
report: .karate-output/surefire-reports/01.exp.ss2_gql.tests.api.conv_search.json
scenarios: 1 | passed: 1 | failed: 0 | time: 0.0000
---------------------------------------------------------
01:31:52.788 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<pass>> feature 5 of 25: 01/exp/ss2_gql/tests/api/org_test.feature
---------------------------------------------------------
feature: 01/exp/ss2_gql/tests/api/org_test.feature
report: .karate-output/surefire-reports/01.exp.ss2_gql.tests.api.org_test.json
scenarios: 4 | passed: 4 | failed: 0 | time: 0.0000
---------------------------------------------------------
01:31:52.829 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<pass>> feature 22 of 25: 01/exp/ss2_gql/tests/api/message_notifications_test.feature
---------------------------------------------------------
feature: 01/exp/ss2_gql/tests/api/message_notifications_test.feature
report: .karate-output/surefire-reports/01.exp.ss2_gql.tests.api.message_notifications_test.json
scenarios: 1 | passed: 1 | failed: 0 | time: 0.0000
---------------------------------------------------------
01:31:52.846 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<pass>> feature 23 of 25: 01/exp/ss2_gql/tests/api/auth_test.feature
---------------------------------------------------------
feature: 01/exp/ss2_gql/tests/api/auth_test.feature
report: .karate-output/surefire-reports/01.exp.ss2_gql.tests.api.auth_test.json
scenarios: 2 | passed: 2 | failed: 0 | time: 0.0000
---------------------------------------------------------
01:31:52.858 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<pass>> feature 24 of 25: 01/exp/ss2_gql/tests/api/update_conversation_read_status_test.feature
---------------------------------------------------------
feature: 01/exp/ss2_gql/tests/api/update_conversation_read_status_test.feature
report: .karate-output/surefire-reports/01.exp.ss2_gql.tests.api.update_conversation_read_status_test.json
scenarios: 2 | passed: 2 | failed: 0 | time: 0.0000
---------------------------------------------------------
01:31:52.908 [pool-1-thread-1] INFO com.intuit.karate.Runner - <<pass>> feature 25 of 25: 01/exp/ss2_gql/tests/api/people_search.feature
---------------------------------------------------------
feature: 01/exp/ss2_gql/tests/api/people_search.feature
report: .karate-output/surefire-reports/01.exp.ss2_gql.tests.api.people_search.json
scenarios: 11 | passed: 11 | failed: 0 | time: 0.0000
---------------------------------------------------------
HTML report: (paste into browser to view) | Karate version: 0.9.6
file:/codebuild/output/src992/src/s3/00/.karate-output/surefire-reports/karate-summary.html
===================================================================
Karate version: 0.9.6
======================================================
elapsed: 2.43 | threads: 1 | thread time: 0.00
features: 8 | ignored: 17 | efficiency: 0.00
scenarios: 31 | passed: 31 | failed: 0
======================================================