-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add tests for Greengrass samples: IPC and discovery. - Add new CI job for Greengrass tests. - Fix resources leak in greengrass-discovery sample. - Add to run_in_ci.py script a possibility to provide data to runnable's stdin.
- Loading branch information
Showing
20 changed files
with
891 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ env: | |
CI_JOBS_ROLE: arn:aws:iam::180635532705:role/CI_Jobs_Role | ||
CI_FLEET_PROVISIONING_ROLE: arn:aws:iam::180635532705:role/service-role/CI_FleetProvisioning_Role | ||
CI_GREENGRASS_ROLE: arn:aws:iam::180635532705:role/CI_Greengrass_Role | ||
CI_GREENGRASS_INSTALLER_ROLE: arn:aws:iam::180635532705:role/CI_GreengrassInstaller_Role | ||
CI_DEVICE_ADVISOR: arn:aws:iam::180635532705:role/CI_DeviceAdvisor_Role | ||
CI_X509_ROLE: arn:aws:iam::180635532705:role/CI_X509_Role | ||
CI_MQTT5_ROLE: arn:aws:iam::180635532705:role/CI_MQTT5_Role | ||
|
@@ -637,11 +638,66 @@ jobs: | |
- name: run MQTT5 Shared Subscription sample | ||
run: | | ||
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_mqtt5_shared_subscription_cfg.json | ||
# Runs the Greengrass samples | ||
linux-greengrass-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: | ||
- 17 | ||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
steps: | ||
- name: Checkout Sources | ||
uses: actions/checkout@v2 | ||
- name: Setup Java | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: temurin | ||
java-version: ${{ matrix.version }} | ||
cache: maven | ||
- name: Build ${{ env.PACKAGE_NAME }} + consumers | ||
run: | | ||
java -version | ||
mvn install -Dmaven.test.skip | ||
- name: Install Greengrass Development Kit | ||
run: | | ||
python3 -m pip install awsiotsdk | ||
python3 -m pip install -U git+https://github.com/aws-greengrass/[email protected] | ||
- name: configure AWS credentials (Greengrass) | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: ${{ env.CI_GREENGRASS_ROLE }} | ||
role-to-assume: ${{ env.CI_GREENGRASS_INSTALLER_ROLE }} | ||
aws-region: ${{ env.AWS_DEFAULT_REGION }} | ||
- name: run Greengrass Discovery sample | ||
run: | | ||
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_greengrass_discovery_cfg.json | ||
- name: Build and run Greengrass basic discovery sample | ||
working-directory: ./tests/greengrass/basic_discovery | ||
run: | | ||
gdk component build | ||
gdk test-e2e build | ||
gdk test-e2e run | ||
- name: Show logs | ||
working-directory: ./tests/greengrass/basic_discovery | ||
# Print logs unconditionally to provide more details on Greengrass run even if the test failed. | ||
if: always() | ||
run: | | ||
echo "=== greengrass.log" | ||
cat testResults/gg*/greengrass.log | ||
echo "=== software.amazon.awssdk.sdk-gg-test-discovery.log" | ||
cat testResults/gg*/software.amazon.awssdk.sdk-gg-test-discovery.log | ||
- name: Build and run Greengrass IPC sample | ||
working-directory: ./tests/greengrass/ipc | ||
run: | | ||
gdk component build | ||
gdk test-e2e build | ||
gdk test-e2e run | ||
- name: Show logs | ||
working-directory: ./tests/greengrass/ipc | ||
# Print logs unconditionally to provide more details on Greengrass run even if the test failed. | ||
if: always() | ||
run: | | ||
echo "=== greengrass.log" | ||
cat testResults/gg*/greengrass.log | ||
echo "=== software.amazon.awssdk.sdk-gg-ipc.log" | ||
cat testResults/gg*/software.amazon.awssdk.sdk-gg-ipc.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
{ | ||
"language": "Java", | ||
"runnable_file": "samples/Greengrass", | ||
"language": "Java JAR", | ||
"runnable_file": "GreengrassDiscoveryTest-1.0-SNAPSHOT-jar-with-dependencies.jar", | ||
"runnable_region": "us-east-1", | ||
"runnable_main_class": "greengrass.BasicDiscovery", | ||
"runnable_main_class": "", | ||
"arguments": [ | ||
{ | ||
"name": "--cert", | ||
"secret": "ci/Greengrass/cert", | ||
"secret": "ci/GreengrassDiscovery/cert", | ||
"filename": "tmp_certificate.pem" | ||
}, | ||
{ | ||
"name": "--key", | ||
"secret": "ci/Greengrass/key", | ||
"secret": "ci/GreengrassDiscovery/key", | ||
"filename": "tmp_key.pem" | ||
}, | ||
{ | ||
"name": "--ca_file", | ||
"secret": "ci/Greengrass/ca", | ||
"filename": "tmp_ca.pem" | ||
"name": "--thing_name", | ||
"data": "CI_Greengrass_Discovery_Thing" | ||
}, | ||
{ | ||
"name": "--region", | ||
"data": "us-east-1" | ||
}, | ||
{ | ||
"name": "--thing_name", | ||
"data": "CI_GreenGrass_Thing" | ||
"name": "--topic", | ||
"data": "clients/CI_Greengrass_Discovery_Thing/hello/world/$INPUT_UUID" | ||
}, | ||
{ | ||
"name": "--print_discover_resp_only", | ||
"data": "" | ||
"name": "--mode", | ||
"data": "publish" | ||
} | ||
] | ||
], | ||
"stdin_file": "messages.txt" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.