aws-greengrass / aws-greengrass-testing

This AWS Greengrass test framework is a collection of building blocks to support end to end QA automation from the customer perspective.
Apache License 2.0
12 stars 3 forks source link

(DeploymentSteps): Platform of Manifests in local recipes does'n works #209

Closed bgklika closed 1 year ago

bgklika commented 1 year ago

Describe the bug When we create (or use existing component) recipe for component run on Linux and Windows we can't use Platform due to Artifacts does not found. Looks like OTF code searching only for global but not inside Platform Artifacts/URL.

Priority Critical due to now component can't provide different artifacts for Linux and Windows

To Reproduce Create multi-platform component in local-store and try to deploy it. Simplest way just take existing multi-platform component and adapt URLs to point to local-store artifacts.

Expected behavior Correct recipe should be processed and platform-specific artifacts used.

Actual behavior Code can't found artifact URLs in recipe and failed on next steps with exception:

[ERROR] 2023-06-27 23:12:10.655 [main] feature - Failed at step: 'I install the component aws.greengrass.clientdevices.mqtt.Bridge from local store with configuration'
java.lang.IllegalArgumentException: argument "src" is null
        at com.fasterxml.jackson.databind.ObjectMapper._assertNotNull(ObjectMapper.java:4757) ~[client-devices-auth-testing-features.jar:?]
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3592) ~[client-devices-auth-testing-features.jar:?]
        at com.aws.greengrass.testing.component.LocalComponentPreparationService.prepare(LocalComponentPreparationService.java:89) ~[client-devices-auth-testing-features.jar:?]
        at com.aws.greengrass.testing.component.CompositeComponentPreparationService.lambda$prepare$0(CompositeComponentPreparationService.java:31) ~[client-devices-auth-testing-features.jar:?]
        at java.util.Optional.map(Optional.java:265) ~[?:?]
        at com.aws.greengrass.testing.component.CompositeComponentPreparationService.prepare(CompositeComponentPreparationService.java:29) ~[client-devices-auth-testing-features.jar:?]
        at com.aws.greengrass.testing.features.DeploymentSteps.lambda$parseComponentNamesAndPrepare$1(DeploymentSteps.java:326) ~[client-devices-auth-testing-features.jar:?]
        at java.util.Arrays$ArrayList.forEach(Arrays.java:4390) ~[?:?]
        at com.aws.greengrass.testing.features.DeploymentSteps.parseComponentNamesAndPrepare(DeploymentSteps.java:313) ~[client-devices-auth-testing-features.jar:?]
        at com.aws.greengrass.testing.features.DeploymentSteps.installComponent(DeploymentSteps.java:188) ~[client-devices-auth-testing-features.jar:?]
        at com.aws.greengrass.testing.features.DeploymentSteps.installComponentWithConfiguration(DeploymentSteps.java:167) ~[client-devices-auth-testing-features.jar:?]
        at ✽.I install the component aws.greengrass.clientdevices.mqtt.Bridge from local store with configuration(classpath:greengrass/features/ggmq-1.feature:1067) ~[?:?]

Environment

Additional context Untested workaround: provide artifacts for all Platform outside Platform array. But that mean we need to add in uber jar large artifacts for another platform.

bgklika commented 1 year ago

When check the original issue found another: OTF use case sensetive parsing of recipe files. For example it use string "URI" as key for Artifacts URIs. It matched to AWS IoT Greengrass component recipe reference.

But when open Greengrass/Components on IoT Core and view JSON or YAML format of recipe of existing component - for example EMQX we can see "Uri" instead of "URI". That means recipes from IoT Core can't be directly used in OTF scenarios.

bgklika commented 1 year ago

Resolved in https://github.com/aws-greengrass/aws-greengrass-testing/pull/218