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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 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.

@wadethestealth wadethestealth force-pushed the wadethestealth:test-fixing branch from 54b40b7 to 18c0da8 Oct 19, 2019
@smashwilson smashwilson mentioned this pull request Oct 19, 2019
6 of 6 tasks complete
@wadethestealth wadethestealth force-pushed the wadethestealth:test-fixing branch from 18c0da8 to c1dabef Oct 19, 2019
Copy link
Member

smashwilson left a comment

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 and others added 8 commits Oct 20, 2019
Co-Authored-By: Ash Wilson <smashwilson@github.com>
@wadethestealth

This comment has been minimized.

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.

@wadethestealth wadethestealth requested a review from smashwilson Oct 20, 2019
Copy link
Member

smashwilson left a comment

@smashwilson smashwilson merged commit 0b58cd4 into atom:master Oct 20, 2019
7 checks passed
7 checks passed
atom.github Build #20191020.8 succeeded
Details
atom.github (Lint) Lint succeeded
Details
atom.github (Linux) Linux succeeded
Details
atom.github (MacOS) MacOS succeeded
Details
atom.github (MacOS) MacOS succeeded
Details
atom.github (Snapshot) Snapshot succeeded
Details
atom.github (Windows) Windows succeeded
Details
@wadethestealth wadethestealth deleted the wadethestealth:test-fixing branch Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.