Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: spooler uats #38

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: spooler uats #38

wants to merge 1 commit into from

Conversation

jcosentino11
Copy link
Contributor

@jcosentino11 jcosentino11 commented Nov 15, 2023

Issue #, if available:

Description of changes:

Add OTF to the project and port over one basic UAT.

⚠️ Requires aws-greengrass/aws-greengrass-testing#233 or else mqtt5 crt native methods won't work.

⚠️ Rest of the UATs need to be ported over, will do in follow up PRs

Testing
Passing when running locally

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<testsuite errors="0" failures="0" name="io.cucumber.core.plugin.JUnitFormatter" skipped="0" tests="1" time="114.177">
<testcase classname="DiskSpooler-1" name="DiskSpooler-1-T1: MQTT messages are published to IoT Core" time="113.907">
<system-out><![CDATA[Given my device is registered as a Thing....................................passed
And my device is running Greengrass.........................................passed
And I start an assertion server.............................................passed
Then I create a random name as cloud_topic..................................passed
When I subscribe to cloud topics............................................passed
Given I create a Greengrass deployment with components......................passed
And I update my Greengrass deployment configuration, setting the component aws.greengrass.Nucleus configuration to:.passed
And I deploy the Greengrass deployment configuration........................passed
Then the Greengrass deployment is COMPLETED on the device after 3 minutes...passed
Then I verify the aws.greengrass.DiskSpooler component is RUNNING using the greengrass-cli.passed
Then I wait 20 seconds......................................................passed
When I install the component IotMqttPublisher from local store with configuration.passed
And I get 1 assertion with context "Successfully published to IoT topic ${cloud_topic}".passed
Then the cloud topic ${cloud_topic} receives the following messages within 10 seconds.passed
]]></system-out>
</testcase>
</testsuite>

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

github-actions bot commented Nov 15, 2023

Unit Tests Coverage Report

File Coverage Lines Branches
All files 91% 85% 97%
com.aws.greengrass.disk.spool.DiskSpoolDAO$RemoveSpoolMessageById 100% 100% 0%
com.aws.greengrass.disk.spool.DiskSpoolDAO$CachedStatement 94% 88% 100%
com.aws.greengrass.disk.spool.DiskSpoolDAO$CreateSpoolerTable 100% 100% 0%
com.aws.greengrass.disk.spool.DiskSpoolDAO$GetSpoolMessageById 100% 100% 100%
com.aws.greengrass.disk.spool.DiskSpoolDAO 87% 83% 90%
com.aws.greengrass.disk.spool.DiskSpoolDAO$GetSpoolMessageById$1 100% 100% 0%
com.aws.greengrass.disk.spool.DiskSpool 61% 61% 0%
com.aws.greengrass.disk.spool.DiskSpoolDAO$InsertSpoolMessage 97% 94% 100%
com.aws.greengrass.disk.spool.DiskSpoolDAO$GetAllSpoolMessageIds 100% 100% 100%

Minimum allowed coverage is 65%

Generated by 🐒 cobertura-action against 4711fb7

public void close() {
if (server != null) {
server.stop(0);
((ExecutorService) server.getExecutor()).shutdownNow();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.

Call shutdown() to reject any incoming tasks and awaitTermination() to wait for existing tasks to complete or until a timeout is reached. To stop the execution and processing of tasks, if necessary, call shutdownNow(). Check the return value of awaitTermination() and handle when the method times out while waiting for other threads to stop executing. See the following diffs on GitHub that make this code change: diff1, diff2

Learn more: ExecutorService in the Java Platform, Standard Edition 8 API Specification

client.close();
}
}
executorService.shutdownNow();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.

Call shutdown() to reject any incoming tasks and awaitTermination() to wait for existing tasks to complete or until a timeout is reached. To stop the execution and processing of tasks, if necessary, call shutdownNow(). Check the return value of awaitTermination() and handle when the method times out while waiting for other threads to stop executing. See the following diffs on GitHub that make this code change: diff1, diff2

Learn more: ExecutorService in the Java Platform, Standard Edition 8 API Specification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants