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

Don't use $HOME on most tests (InternalFixture) #971

Merged
merged 5 commits into from
Aug 13, 2021

Conversation

chapulina
Copy link
Contributor

@chapulina chapulina commented Aug 12, 2021

Signed-off-by: Louise Poubel louise@openrobotics.org

🦟 Bug fix

Summary

Tests shouldn't be relying on the user's home folder. This makes sure that most tests use the server.config from a custom home path.

I think I caught all tests that are loading ~/.ignition/gazebo/server.config. This PR also fixes creating the config file in general, because now we make sure that the directories are created too.

It also backports EnvTestFixture from #594, with some updates to make sure each test can keep its name, as well as supporting various test types.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina requested a review from adlarkin August 12, 2021 23:47
@github-actions github-actions bot added the 🏰 citadel Ignition Citadel label Aug 12, 2021
src/Server_TEST.cc Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 13, 2021

Codecov Report

Merging #971 (76435b6) into ign-gazebo3 (76c7b39) will decrease coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@               Coverage Diff               @@
##           ign-gazebo3     #971      +/-   ##
===============================================
- Coverage        77.88%   77.86%   -0.03%     
===============================================
  Files              221      221              
  Lines            12681    12683       +2     
===============================================
- Hits              9877     9876       -1     
- Misses            2804     2807       +3     
Impacted Files Coverage Δ
src/ServerPrivate.cc 84.15% <ø> (-0.24%) ⬇️
src/ServerConfig.cc 90.28% <66.66%> (-0.67%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76c7b39...76435b6. Read the comment docs.

Copy link
Contributor

@adlarkin adlarkin left a comment

Choose a reason for hiding this comment

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

I know there are other tests still loading ~/.ignition/gazebo/server.config

Should we create an issue with all the tests that are still loading ~/.ignition/gazebo/server.config so that we can keep track of what needs to be updated?

test/helpers/EnvTestFixture.hh Outdated Show resolved Hide resolved
test/helpers/EnvTestFixture.hh Outdated Show resolved Hide resolved
Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina
Copy link
Contributor Author

all the tests that are still loading ~/.ignition/gazebo/server.config

Ok, I went ahead and fixed almost all of them (if not all): 886b788

@chapulina chapulina changed the title Don't use $HOME on server test Don't use $HOME on most tests (InternalFixture) Aug 13, 2021
Copy link
Contributor

@adlarkin adlarkin left a comment

Choose a reason for hiding this comment

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

I still need to do a deeper review pass, but before I do, there are a few higher-level questions that I have.

test/integration/battery_plugin.cc Show resolved Hide resolved
test/helpers/EnvTestFixture.hh Show resolved Hide resolved
test/integration/apply_joint_force_system.cc Show resolved Hide resolved
@adlarkin
Copy link
Contributor

There are also a few codecheck issues:

  /github/workspace/src/EntityComponentManager_TEST.cc:97:  Lines should be <= 80 characters long  [whitespace/line_length] [2]
  /github/workspace/src/SimulationRunner_TEST.cc:84:  Lines should be <= 80 characters long  [whitespace/line_length] [2]
  /github/workspace/test/integration/examples_build.cc:126:  Lines should be <= 80 characters long  [whitespace/line_length] [2]
  /github/workspace/test/integration/joint_position_controller_system.cc:43:  Lines should be <= 80 characters long  [whitespace/line_length] [2]
  /github/workspace/test/integration/joint_state_publisher_system.cc:32:  Lines should be <= 80 characters long  [whitespace/line_length] [2]
  /github/workspace/test/integration/scene_broadcaster_system.cc:35:  Line ends in whitespace.  Consider deleting these extra spaces.  [whitespace/end_of_line] [4]
  Total errors found: 6

test/helpers/EnvTestFixture.hh Outdated Show resolved Hide resolved
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina requested a review from azeey as a code owner August 13, 2021 18:55
Copy link
Contributor

@adlarkin adlarkin left a comment

Choose a reason for hiding this comment

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

LGTM, just one question for clarity/understanding below. Maybe we can get one more set of eyes on this to make sure we aren't introducing any new test failures.

src/ServerPrivate.cc Show resolved Hide resolved
Copy link
Contributor

@jennuine jennuine left a comment

Choose a reason for hiding this comment

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

LGTM

@chapulina chapulina dismissed ahcorde’s stale review August 13, 2021 21:53

Using common::joinPaths now

@chapulina chapulina merged commit 4a5a33d into ign-gazebo3 Aug 13, 2021
@chapulina chapulina deleted the chapulina/3/server_test branch August 13, 2021 21:53
@chapulina chapulina mentioned this pull request Sep 14, 2021
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants