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

Feature/bounty client tests #56

Merged

Conversation

pgrzesik
Copy link
Contributor

@pgrzesik pgrzesik commented Jun 1, 2018

Increased test coverage from 44 to 50%, by testing parts of client helpers and bounty client.

I also have a suggestion, to break up tests into separate modules, but I didn't want to additionally include different approach to testing.

@villanuevawill
Copy link
Collaborator

@pgrzesik can you elaborate more on the suggestion? If good, I can put up a bounty for it :)

@villanuevawill
Copy link
Collaborator

@pgrzesik this looks great. I'm going to pay out the bounty now :)

@pgrzesik
Copy link
Contributor Author

pgrzesik commented Jun 4, 2018

@villanuevawill I'm glad you like it! About the suggestion, it's probably not bounty worthy as it would be pretty small refactor at this point. What I'm suggesting to split one big tests.py into smaller modules that have less tests, but specific to e.g. client_helpers, it that case, instead of tests.py, it would be tests/test_bounty_client.py and tests/test_client_helpers.py.

Also, there's still a lot of testing to be done for bounty_client - and I'm up for that challenge if you'd like :)

@villanuevawill villanuevawill merged commit 521a289 into Bounties-Network:master Jun 4, 2018
@villanuevawill
Copy link
Collaborator

@pgrzesik the tests are failing.

@villanuevawill
Copy link
Collaborator

I merged this in/paid out too quickly :/. But the tests are not working.

@villanuevawill
Copy link
Collaborator

ERROR: Failure: ImportError (cannot import name 'bounty_url_for')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/local/lib/python3.6/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/lib/python3.6/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/lib/python3.6/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/local/lib/python3.6/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/local/lib/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/code/std_bounties/tests.py", line 7, in <module>
    from std_bounties.client_helpers import bounty_url_for, \
ImportError: cannot import name 'bounty_url_for'

@pgrzesik you need to rebase master in.

@pgrzesik
Copy link
Contributor Author

pgrzesik commented Jun 4, 2018

@villanuevawill What problems are you experiencing ? Can you show me ? I didn't have any issues and all tests were passing, I will gladly check what's happening and fix it of course

@villanuevawill
Copy link
Collaborator

@pgrzesik it's because master had moved the location on bounty_url_for

@pgrzesik
Copy link
Contributor Author

pgrzesik commented Jun 4, 2018

Fixed in https://github.com/Bounties-Network/BountiesAPI/pull/57/files, sorry about the issue, I didn't saw anything else merged before submitting my PR

@pgrzesik
Copy link
Contributor Author

pgrzesik commented Jun 4, 2018

@villanuevawill Also, what do you think about enabling CircleCI test jobs for PRs from forks ? It could help prevent such errors in the future.

@villanuevawill
Copy link
Collaborator

@pgrzesik good idea - I'll set that up now.

Regarding splitting up the tests, great idea. Also, if you want to keep adding tests I can put another bounty up.

@pgrzesik
Copy link
Contributor Author

pgrzesik commented Jun 4, 2018

@villanuevawill There's still much to test so I'd gladly continue with that task.

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