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

Fix TestTreeWithDatasets failure #117

Merged
merged 1 commit into from
Oct 26, 2022
Merged

Conversation

bpoldrack
Copy link
Member

@bpoldrack bpoldrack commented Oct 25, 2022

Trying to figure a test failure, we missed. Somehow a tree test is picking up the wrong root path to run on. Noticed in core's extension test first, but reproduced here on appveyor.

So, it turns out, that the fixture injection with the TestTreeWithoutDatasets case and the derived test case TestTreeWithDatasets stopped working as intended. The base class' inject_path_no_ds apparently is executed after the derived class' inject_path_ds, overwriting the root path for the test.
Don't know for sure whether that's a change in python or pytest.

This patch switches the approach to have a shared fixture decide dynamically and only once, rather than overwriting each other.

@bpoldrack bpoldrack force-pushed the dbg-tree-failure branch 2 times, most recently from 35a74a0 to 55f471d Compare October 26, 2022 09:23
@bpoldrack bpoldrack changed the title TMP: Do we fail here, too? DEBUG: TestTreeWithDatasets failure Oct 26, 2022
The order of execution of the former markup for the base class vs
derived class somehow changed, leading to the base class' injection
overwriting what the subclass already set for its `path`.
Unsure whether that is depend on python or pytest version.

In any case, that means a setup independent of that order is needed.
Hence, instead of overwriting the `path` class attribute, have a fixture
that dynamically decides based on a another, constant class attribute
defining which kind of tree the test case wants.
@codecov
Copy link

codecov bot commented Oct 26, 2022

Codecov Report

Base: 94.38% // Head: 91.11% // Decreases project coverage by -3.26% ⚠️

Coverage data is based on head (e40a630) compared to base (f350ac2).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head e40a630 differs from pull request most recent head 2496e7b. Consider uploading reports for the commit 2496e7b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #117      +/-   ##
==========================================
- Coverage   94.38%   91.11%   -3.27%     
==========================================
  Files          38       38              
  Lines        3955     4244     +289     
==========================================
+ Hits         3733     3867     +134     
- Misses        222      377     +155     
Impacted Files Coverage Δ
datalad_next/tests/test_tree.py 98.63% <100.00%> (-0.66%) ⬇️
datalad_next/_version.py 45.39% <0.00%> (-54.61%) ⬇️
datalad_next/gitremote/datalad_annex.py 89.89% <0.00%> (+0.27%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bpoldrack bpoldrack changed the title DEBUG: TestTreeWithDatasets failure Fix TestTreeWithDatasets failure Oct 26, 2022
@bpoldrack bpoldrack marked this pull request as ready for review October 26, 2022 12:02
@bpoldrack bpoldrack requested a review from mih as a code owner October 26, 2022 12:02
Copy link
Member

@mih mih left a comment

Choose a reason for hiding this comment

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

Looks good! Thx! Setting to auto-merge.

@mih mih enabled auto-merge October 26, 2022 12:07
@mih mih merged commit 6f03f29 into datalad:main Oct 26, 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.

2 participants