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

Add endpoint_config_connection_error test #455

Merged
merged 18 commits into from
Sep 16, 2022

Conversation

johnrandolph
Copy link
Collaborator

No description provided.

@johnrandolph johnrandolph marked this pull request as ready for review September 16, 2022 16:31
deviceConfig.blobset.blobs.put("_iot_endpoint_config", cfg);

updateConfig();
untilTrue("pubber has attempted endpoint reconfig", () -> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's not always pubber -- this might be running against a manufacturer device

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right PTAL

BlobBlobsetConfig cfg = new BlobBlobsetConfig();
cfg.phase = BlobPhase.FINAL;
// { protocol=mqtt, client_id=test_project/device; hostname=localhost }
cfg.base64 = "ewogICJwcm90b2NvbCI6ICJtcXR0IiwKICAiY2xpZW50X2lkIjogInRlc3RfcHJvamVjdC9kZXZp"
Copy link
Collaborator

Choose a reason for hiding this comment

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

extract to named constant for base64 for readability?

@grafnu
Copy link
Collaborator

grafnu commented Sep 16, 2022 via email

import org.junit.Test;
import udmi.schema.BlobBlobsetConfig;
Copy link
Collaborator

Choose a reason for hiding this comment

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

extra stuff not necessary anymore?

Copy link
Collaborator Author

@johnrandolph johnrandolph Sep 16, 2022

Choose a reason for hiding this comment

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

Which thing is extra?

Copy link
Collaborator

Choose a reason for hiding this comment

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

All the changes in the file... aren't they leftover from when you had the test itself in there?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh haha. Yes of course. One moment

Copy link
Collaborator

@grafnu grafnu left a comment

Choose a reason for hiding this comment

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

The code here looks fine, but I'd expect there to be some accompanying generated.md changes? It should automatically pick up that there's a new test... so if there isn't I'd like to know so I can track that down!

deviceConfig.blobset.blobs.put(String.valueOf(SystemBlobsets.IOT_ENDPOINT_CONFIG), config);

untilTrue("device tried endpoint config which resulted in connection error", () -> {
Entry stateStatus = deviceState.blobset.blobs.get(SystemBlobsets.IOT_ENDPOINT_CONFIG).status;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this works it's fine, but I'd be wondering why .value() isn't necessary here when it is elsewhere... basically if this doesn't work for some reason just something to consider!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

idk, I let intellij ask for the other value()

Copy link
Collaborator Author

@johnrandolph johnrandolph left a comment

Choose a reason for hiding this comment

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

Ok PTAL

@johnrandolph johnrandolph merged commit c5940b4 into faucetsdn:master Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants