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

test: Fix remaining test failures from built-in bridge #2879

Merged
merged 14 commits into from
May 31, 2024

Conversation

jarhodes314
Copy link
Contributor

@jarhodes314 jarhodes314 commented May 15, 2024

Proposed changes

This PR fixes some remaining issues with the built-in bridge so that the tests work with the built-in bridge enabled.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue


Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 22.42991% with 166 lines in your changes are missing coverage. Please review.

Project coverage is 77.8%. Comparing base (d52bbdf) to head (299627a).
Report is 3 commits behind head on main.

Additional details and impacted files
Files Coverage Δ
...core/tedge/src/cli/disconnect/disconnect_bridge.rs 32.8% <100.0%> (-0.5%) ⬇️
crates/extensions/tedge_mqtt_bridge/src/config.rs 96.1% <100.0%> (ø)
crates/extensions/tedge_mqtt_bridge/src/health.rs 95.0% <100.0%> (+0.1%) ⬆️
crates/core/c8y_api/src/smartrest/inventory.rs 58.8% <94.1%> (+1.9%) ⬆️
crates/core/tedge/src/cli/common.rs 0.0% <0.0%> (ø)
crates/extensions/tedge_mqtt_bridge/src/lib.rs 89.1% <96.0%> (-0.1%) ⬇️
crates/extensions/tedge_mqtt_bridge/src/topics.rs 71.4% <20.0%> (-20.3%) ⬇️
crates/core/tedge/src/cli/refresh_bridges.rs 0.0% <0.0%> (ø)
crates/core/tedge/src/cli/connect/command.rs 0.0% <0.0%> (ø)
crates/core/tedge_mapper/src/c8y/mapper.rs 0.0% <0.0%> (ø)

... and 5 files with indirect coverage changes

Copy link
Contributor

github-actions bot commented May 15, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
444 0 3 444 100 1h1m32.791408999s

@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 15, 2024 11:57 — with GitHub Actions Inactive
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 15, 2024 15:22 — with GitHub Actions Inactive
@jarhodes314 jarhodes314 force-pushed the enable-bridge-for-robot-tests branch from dc35b3f to 6dd0e52 Compare May 15, 2024 15:47
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 15, 2024 15:47 — with GitHub Actions Inactive
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 15, 2024 16:15 — with GitHub Actions Inactive
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 16, 2024 13:16 — with GitHub Actions Inactive
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 16, 2024 17:14 — with GitHub Actions Inactive
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 16, 2024 18:27 — with GitHub Actions Inactive
@jarhodes314 jarhodes314 force-pushed the enable-bridge-for-robot-tests branch from 2ecba4d to fc33478 Compare May 17, 2024 09:32
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 17, 2024 09:32 — with GitHub Actions Inactive
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 17, 2024 14:51 — with GitHub Actions Inactive
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 17, 2024 14:58 — with GitHub Actions Inactive
@@ -72,7 +74,36 @@ impl TEdgeComponent for CumulocityMapper {
tc.forward_from_remote(topic, local_prefix.clone(), "")?;
}

tc.forward_from_local("#", local_prefix, "")?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this was genuinely problematic as Cumulocity doesn't send us our own messages back, but I've changed the config to match the current bridge config in any case

…file

Signed-off-by: James Rhodes <jarhodes314@gmail.com>
…of mosquitto config

Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
…dition to new logic

Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
…reserved

Signed-off-by: James Rhodes <jarhodes314@gmail.com>
…and flakiness

Signed-off-by: James Rhodes <jarhodes314@gmail.com>
@jarhodes314 jarhodes314 force-pushed the enable-bridge-for-robot-tests branch from c299254 to 30b0e61 Compare May 21, 2024 08:44
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 21, 2024 08:44 — with GitHub Actions Inactive
…enabling built in bridge

Signed-off-by: James Rhodes <jarhodes314@gmail.com>
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 29, 2024 15:07 — with GitHub Actions Inactive
@jarhodes314 jarhodes314 changed the title Enable the built-in bridge for robot testing Fix remaining test failures from built-in bridge May 29, 2024
@jarhodes314 jarhodes314 marked this pull request as ready for review May 29, 2024 16:30
Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

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

Approved. A nice step forward!

Once this PR merged, it would be good to re-run all the tests under a draft PR with the default value for mqtt.bridge.built_in set to true.

@@ -375,6 +377,7 @@ enum Status {
impl Status {
fn json(self) -> &'static str {
match self {
// TODO Robot test that I make it to Cumulocity
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't get this TODO. What has to be done?

Comment on lines +673 to +674
// This will forcefully create directory structure if it doesn't exist, we should find better way to do it, maybe config should deal with it?
create_directories(dir_path)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah. The directories should be created by tedge init and tedge connect should fail if given a path with unknown parents.

@jarhodes314 jarhodes314 added this pull request to the merge queue May 31, 2024
Merged via the queue into thin-edge:main with commit ba2b00a May 31, 2024
32 checks passed
@reubenmiller reubenmiller added the theme:mqtt Theme: mqtt and mosquitto related topics label Jun 6, 2024
@reubenmiller reubenmiller changed the title Fix remaining test failures from built-in bridge test: Fix remaining test failures from built-in bridge Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:mqtt Theme: mqtt and mosquitto related topics theme:testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants