Reorganize unit test files to match the structure of the code under test
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reviewing the existing unit-test files alongside the code under test, then read the linked restructuring issue #497 to understand the intended code layout. Reorganize tests so each code path has a corresponding test file and test-name prefix; done means the test location is unambiguous and the relevant suite still passes.
Written by the indexing model from the issue text.
Description
Currently, it is hard to determine where a test should go, since a lot of the test files are organized around overlapping features, resulting in multiple places that could seem like the right place for the tests.
This disorganization can make it harder to:
- find where to put a new test
- notice duplicate tests
- determine if a code path is tested
- run the relevant tests for a code change
I think this disorganization largely came from the disorganization of the code under test (https://github.com/Shopify/identity_cache/issues/497).
Instead, tests for a code path in the code under test belongs in a test file with a corresponding name and in a test name prefixed with a corresponding test name prefix. Note that a test can be for a code path in a method without directly calling it.
- Dominant language
- Ruby
- Stars
- 2k
- Forks
- 174
- Avg merge
- 13m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Shopify/identity_cache
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Shopify/identity_cache#568 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Shopify/identity_cache#555 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Shopify/identity_cache#539 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Shopify/identity_cache#535 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Shopify/identity_cache#533 · 1 comment ·
All issues in Shopify/identity_cache
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheOdinProject/curriculum#31408 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
notch8/utk_knapsack#148 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Homebrew/homebrew-cask#288729 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100