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

Make tests pass #446

Merged
merged 3 commits into from
Feb 8, 2024
Merged

Make tests pass #446

merged 3 commits into from
Feb 8, 2024

Conversation

Gallaecio
Copy link
Member

@Gallaecio Gallaecio commented Feb 8, 2024

Post-merge to-do:

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5bc420e) 89.44% compared to head (02ebf34) 89.44%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #446   +/-   ##
=======================================
  Coverage   89.44%   89.44%           
=======================================
  Files          34       34           
  Lines        2407     2407           
=======================================
  Hits         2153     2153           
  Misses        254      254           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Gallaecio Gallaecio marked this pull request as ready for review February 8, 2024 13:38
from setuptools import setup, find_packages


about = {}
here = os.path.abspath(os.path.dirname(__file__))
Copy link
Member Author

Choose a reason for hiding this comment

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

The use of __file__ here was problematic due to some weird code calling setup.py with exec, and given the purpose for which it was being used here, this seems like the cleaner fix to me.

Comment on lines +95 to +98
r'Building registry\.io/user/project:1\.0\.'
r'Steps: 0%\| +\| 0/1'
r'Steps: 100%\|█+\| 3/3'
r'The image registry\.io/user/project:1\.0 build is completed\.'
Copy link
Member Author

Choose a reason for hiding this comment

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

invoke above allows specifying a terminal width, but this seemed easier than to find the right width for some reason. But I can try the width approach if you prefer.

if os.path.exists(self.status_file):
os.remove(self.status_file)

def tearDown(self):
os.chdir(self.curdir)
Copy link
Member Author

Choose a reason for hiding this comment

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

The lack of this was causing trouble down the line when executing all tests.

@@ -25,7 +25,7 @@ def setUp(self):
self.curdir = os.getcwd()
self.fake_requester = FakeRequester()
deploy_egg.utils.make_deploy_request = self.fake_requester.fake_request
self.tmp_dir = tempfile.mktemp(prefix="shub-test-deploy-eggs")
self.tmp_dir = tempfile.mkdtemp(prefix="shub-test-deploy-eggs")
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure how it ever worked before.

@@ -35,7 +35,8 @@ def tearDown(self):
def test_parses_project_information_correctly(self):
# this test's assertions are based on the values
# defined on this folder's setup.py file
shutil.copytree('tests/samples/deploy_egg_sample_project/', self.tmp_dir)
shutil.rmtree(self.tmp_dir)
shutil.copytree('tests/samples/deploy_egg_sample_project', self.tmp_dir)
Copy link
Member Author

Choose a reason for hiding this comment

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

Had started failing due to self.tmp_dir existing already, not sure how it worked before either.

@Gallaecio Gallaecio merged commit 822b289 into scrapinghub:master Feb 8, 2024
33 checks passed
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.

None yet

2 participants