question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refactor tests so they all run as part of CI.

Currently, there are tests associated with UI, deployment, algorithms, and girder client. Some of the algorithm and girder client tests use unittest and are not currently run as part of CI. This gives an artificially low value for reported code coverage. Further, many of these attach to a remote server which is mutable and may cause the tests to fail in the future.

After removing UI and deployment from this repo, the remaining tests will no longer strictly require Girder. They should be refactored so that they all run in CI.

I recommend:

  • Tests are refactored to use pytest. This will result in some changes to how asserts are used. For instance, in unittest we do self.assertTupleEqual(a, b) while in pytest we can do assert a == b.
  • Tests are refactored to run without a remove server. Since we still want to test connecting to a Girder server, we can stand up a test server in a docker container, load it with appropriate data, and test against that.
  • Tests are configured to run using tox as the test harness rather than cmake. This will make it easier to test multiple python versions. To run new tests, rather than executing the test files directly, we would run something like tox -e py37 -- -k algorithm_test.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mantheycommented, Feb 18, 2020

As part of this, we’ll want to move all issues to the appropriate repos.

1reaction
mantheycommented, Feb 18, 2020

UI has moved to https://github.com/DigitalSlideArchive/HistomicsUI. Deployment has moved to https://github.com/DigitalSlideArchive/digital_slide_archive.

Before removing the UI code here, I’ll make a 2.x-maintenance branch. The main README will include links to the UI and deployment repos.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should you refactor test code? - Medium
Test code is a different beast than non-test code. We generally want our tests to be extremely simple and easy to read: if...
Read more >
How do I refactor unit tests? [closed] - Stack Overflow
Before refactoring a section of code, a solid set of automatic unit tests is needed. The tests are used to demonstrate that the...
Read more >
Why you should refactor your test automation scripts
Refactoring in testing: The benefits. Fowler's strict definition is that refactoring is only for code. It "improves the design, maintenance, and readability of ......
Read more >
3 Easy Steps to Refactoring Tests for Greater Clarity
3 Easy Steps to Refactoring Tests for Greater Clarity · Step 1: Always Start from Green · Step 2: Extract What's Common into...
Read more >
Code Refactoring: What You Need to Know About It
As a tester, refactoring of code roughly translates to = in-depth testing + regression testing. In-depth testing need to include all the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found