Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add readmes
  • Loading branch information
sfodagain committed Jun 5, 2024
commit 0ee4c4486b10d8abe40d1bee67a716f68e7d16c8
44 changes: 44 additions & 0 deletions test/greengrass/basic_discovery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Test for Greengrass Discovery Sample

Greengrass discovery test runs using [Greengrass Development Kit Command-Line Interface](https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-development-kit-cli.html) (GDK CLI).

### Greengrass discovery component

For Greengrass discovery sample to work, a Greengrass component subscribed to a particular topic is required.
The following files defines this custom component:

- [gdk-config.json](./gdk-config.json) - `gdk` reads this file to build and publish component.
- [copy_files.sh](./copy_files.sh) - utility to copy all required files for `gdk` to be able to build the component.
- [recipe.yaml](./recipe.yaml) - defines a component's details, dependencies, artifacts, and lifecycles.
- [hello_world_subscriber.py](./hello_world_subscriber.py) - a simple Greengrass client that subscribes to a given topic using Greengrass IPC.

### How the test runs

The first step is to build GreengrassV2 component artifacts and recipes from its source code:

```shell
gdk component build
```

Then the following command builds the testing module:

```shell
gdk test-e2e build
```

Finally, the test can run:

```shell
gdk test-e2e run
```

The test behavior is defined in the [component.feature](./gg-e2e-tests/src/main/resources/greengrass/features/component.feature)
config file using a domain-specific language called [Gherkin](https://docs.aws.amazon.com/greengrass/v2/developerguide/gg-testing-framework.html).

The test spins up Greengrass core, installs and configures Greengrass component dependencies (including the custom
Greengrass component described in the previous section). After everything is set up, it performs checks. They are defined
at the very bottom of the file and basically grep a log file for specific messages.

On completion, the test creates log files in `testResult` directory with the run details. The component's logs are stored
in `testResult/gg-<RANDOM_STRING>/software.amazon.awssdk.sdk-gg-test-discovery.log` file. Though, if error occurred before
the component started its execution, this file might be absent.
43 changes: 43 additions & 0 deletions test/greengrass/ipc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Test for Greengrass IPC Sample

Greengrass IPC test runs using [Greengrass Development Kit Command-Line Interface](https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-development-kit-cli.html) (GDK CLI).

### Greengrass IPC component

For Greengrass IPC sample to work, it should be deployed as a Greengrass component.
The following files defines this component:

- [gdk-config.json](./gdk-config.json) - `gdk` reads this file to build and publish component.
- [copy_files.sh](./copy_files.sh) - utility to copy all required files for `gdk` to be able to build the component.
- [recipe.yaml](./recipe.yaml) - defines a component's details, dependencies, artifacts, and lifecycles.

### How the test runs

The first step is to build GreengrassV2 component artifacts and recipes from its source code:

```shell
gdk component build
```

Then the following command builds the testing module:

```shell
gdk test-e2e build
```

Finally, the test can run:

```shell
gdk test-e2e run
```

The test behavior is defined in the [component.feature](./gg-e2e-tests/src/main/resources/greengrass/features/component.feature)
config file using a domain-specific language called [Gherkin](https://docs.aws.amazon.com/greengrass/v2/developerguide/gg-testing-framework.html).

The test spins up Greengrass core, installs and configures Greengrass component dependencies (including the custom
Greengrass component described in the previous section). After everything is set up, it performs checks. They are defined
at the very bottom of the file and basically grep a log file for specific messages.

On completion, the test creates log files in `testResult` directory with the run details. The component's logs are stored
in `testResult/gg-<RANDOM_STRING>/software.amazon.awssdk.sdk-gg-ipc.log` file. Though, if error occurred before the
component started its execution, this file might be absent.