Skip to content

Conversation

@shaneahmed
Copy link
Member

@shaneahmed shaneahmed commented Feb 18, 2022

  • tox.ini modified to pass Travis variables which fixes the tests.
  • Updated tests to run locally for Travis detection.
  • Reduces Travis runtime by up to 5 mins per run.

- The test should pass on travis.
- Try different solution to travis checks
- Previous setting
@shaneahmed shaneahmed changed the title DEV: Skip test_kather_dataset_default test DEV: Skip test_kather_dataset_default test Feb 18, 2022
@shaneahmed shaneahmed self-assigned this Feb 18, 2022
@shaneahmed shaneahmed added bug Something isn't working dev tools Changes/Updates in Development tools labels Feb 18, 2022
- Try different solution to detect Travis
- Set env variable and check
- Try if ON_TRAVIS exists
- Change check for travis.
- Remove ON_TRAVIS variable.
- Revert back the changes
- Revert changes on .travis.yml
- Pass environment variables from travis to tox
@codecov
Copy link

codecov bot commented Feb 19, 2022

Codecov Report

Merging #292 (a16c018) into develop (b6751f9) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #292   +/-   ##
========================================
  Coverage    99.82%   99.82%           
========================================
  Files           53       53           
  Lines         5004     5004           
  Branches       823      823           
========================================
  Hits          4995     4995           
  Misses           2        2           
  Partials         7        7           
Impacted Files Coverage Δ
tiatoolbox/tools/patchextraction.py 100.00% <0.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 b6751f9...a16c018. Read the comment docs.

@shaneahmed shaneahmed requested a review from John-P February 19, 2022 20:27
@shaneahmed shaneahmed marked this pull request as ready for review February 19, 2022 22:21
- Fix the test_travis_detection to run locally
@shaneahmed shaneahmed changed the title DEV: Skip test_kather_dataset_default test BUG: Fix Travis detection Feb 19, 2022
Comment on lines 1258 to 1262
on_travis = utils.env_detection.running_on_travis()
if "ON_TRAVIS" in os.environ:
assert on_travis
else:
assert not on_travis
Copy link
Contributor

@John-P John-P Feb 21, 2022

Choose a reason for hiding this comment

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

Not sure about this. I think it was better before simply checking that it returns. Maybe could add a check that it is a boolean value. This looks like it will easily break as a test and isn't actually testing anything usefully.

Copy link
Member Author

@shaneahmed shaneahmed Feb 21, 2022

Choose a reason for hiding this comment

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

utils.env_detection.running_on_travis() is dependent on Travis variables. I think it would be unwise to write a test which is relying on the same variables it is testing. So I have forced a test which is relying on a variable which is manually added in case the other variables fail.
This will allow the test to pass locally as well otherwise tests will fail locally.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in this commit 2276838

@John-P John-P changed the title BUG: Fix Travis detection BUG: Fix Travis Detection Feb 21, 2022
- Use a different source of truth to run test
- Try pwd to test travis.
- Fix test to to skip on Windows
- Remove ON_TRAVIS
@shaneahmed shaneahmed merged commit b182489 into develop Feb 21, 2022
@shaneahmed shaneahmed deleted the dev-improve-tests-katherdataset branch February 21, 2022 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dev tools Changes/Updates in Development tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants