Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Fix GitHub Package Tests #2315

Merged
merged 15 commits into from
Oct 20, 2019
Merged

Fix GitHub Package Tests #2315

merged 15 commits into from
Oct 20, 2019

Conversation

wadethestealth
Copy link
Contributor

@wadethestealth wadethestealth commented Oct 19, 2019

Description of the Change

  • Removes state leak from previous tests.
  • Refactors layout/structure of test to reflect BDD best pratices (For good examples, see Better Specs) Note: we prefer describe in place of context.
  • All test functions remain testing the exact same properties.

Benefits

  • Remove state leak.
  • Fix flakes
  • Cleaner test assertion and test description

Possible Drawbacks

This will slow down test, because we were previously not preventing state leak.

Applicable Issues

#2308 Ran into trouble implementing good test cases, because state leak was corrupting the results.

Metrics

  • All tests passing without retries.

Tests

I fixed 'em 😉

Release Notes

Updated test case accuracy.

Copy link
Contributor

@smashwilson smashwilson left a comment

Choose a reason for hiding this comment

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

Major kudos for taking this on 🙌 Bringing old and unwieldy test suites up to date is pretty thankless work, and I really appreciate it. It's looking much better and I see it'll fix a bunch of longstanding flakes along the way.

How are we doing on test coverage so far? This is one of the suites that didn't have great test coverage in the past (and that's even more of a pain to bring up to date after the fact 😅 ). You can check it out locally by running npm run test:coverage and loading the .lcov file with a package like atom-lcov.

I see you've still got the last commented-out bit left to do - re-request review from me when you're ready and we'll get this in 😄

.eslintrc Outdated Show resolved Hide resolved
test/github-package.test.js Show resolved Hide resolved
test/github-package.test.js Show resolved Hide resolved
test/github-package.test.js Outdated Show resolved Hide resolved
test/github-package.test.js Outdated Show resolved Hide resolved
test/github-package.test.js Show resolved Hide resolved
test/github-package.test.js Show resolved Hide resolved
test/github-package.test.js Outdated Show resolved Hide resolved
test/github-package.test.js Outdated Show resolved Hide resolved
@wadethestealth
Copy link
Contributor Author

wadethestealth commented Oct 20, 2019

How are we doing on test coverage so far?

It doesn't seem super awful. I have not covered any new branches though, as I was just updating the old code.
Things I have noticed:

  • Any outside api you are consuming (eg. status bar) is not being covered.
  • A couple of branches are only being tested with one conditional outcome.
  • Serialization is not tested.
  • Yardstick setup is basically untested.
  • A couple of nested function/properties that are functions are not being covered.

Also, the failed test case was not me it was a flake.

Copy link
Contributor

@smashwilson smashwilson left a comment

Choose a reason for hiding this comment

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

@smashwilson smashwilson merged commit 0b58cd4 into atom:master Oct 20, 2019
@wadethestealth wadethestealth deleted the test-fixing branch October 26, 2019 19:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants