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

#227 - temp dir is cleaned up #375

Merged

Conversation

olenagerasimova
Copy link
Member

Part of #227
Created test to verify that temp dir is cleaned up and fixed Rpm to call onTerminate on the outer completable.

@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #375 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #375      +/-   ##
============================================
- Coverage     89.21%   89.20%   -0.01%     
+ Complexity      292      291       -1     
============================================
  Files            48       48              
  Lines          1354     1353       -1     
  Branches         63       63              
============================================
- Hits           1208     1207       -1     
  Misses          137      137              
  Partials          9        9              
Impacted Files Coverage Δ Complexity Δ
src/main/java/com/artipie/rpm/Rpm.java 86.86% <100.00%> (-0.10%) 48.00 <3.00> (-1.00)

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 6ac10a1...3cf11bf. Read the comment docs.

Copy link
Contributor

@olegmoz olegmoz left a comment

Choose a reason for hiding this comment

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

@olenagerasimova thanks, please see one comment

@@ -132,6 +139,29 @@ void updatesDifferentReposSimultaneouslyTwice(final UpdateType update) throws Ex
);
}

@ParameterizedTest
@EnumSource(UpdateType.class)
@Order(Integer.MAX_VALUE)
Copy link
Contributor

Choose a reason for hiding this comment

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

@olenagerasimova could you please explain why order is important in this test suite? Usually it's a bad sign meaning tests are too coupled

Copy link
Member Author

Choose a reason for hiding this comment

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

@olegmoz on each update Rpm create two temp dirs with prefixed meta and repo, running this test after all other tests we can be sure, that not only temp dirs from this particular update were removed, but also all temp dirs from each update of this test class. I've caught the error with onTerminate this way...
I understand, that this logic is not obvious and honestly I'm not a fun of this approach. Another solution I can think of here is to add these assertions to @After method, but it does not seem to be a nice way either. What do you say?

Copy link
Contributor

Choose a reason for hiding this comment

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

@olenagerasimova adding the checks to @After method does not sound good. I guess proper way to do it is to add a check to every test case

Copy link
Contributor

@olegmoz olegmoz left a comment

Choose a reason for hiding this comment

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

@olenagerasimova thanks, looks good to merge

@olenagerasimova olenagerasimova merged commit 87566ce into artipie:master Oct 30, 2020
@olenagerasimova olenagerasimova deleted the 227-temp-dir-is-cleaned-up branch October 30, 2020 15:12
@0crat
Copy link

0crat commented Oct 30, 2020

Job gh:artipie/rpm-adapter#375 is not assigned, can't get performer

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.

3 participants