Skip to content

2.x: Cleanup test local variable names #5907

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

Merged
merged 2 commits into from
Mar 9, 2018

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Mar 9, 2018

Add an unit test that scans the unit test files for common local variable misnaming due to copy-pasting between the types, such as:

  • TestObserver ts <-> TestSubscriber to
  • PublishSubject pp <-> PublishProcessor ps

See the new CheckLocalVariablesInTests for other patterns described with a regexp.

@akarnokd akarnokd added this to the 2.2 milestone Mar 9, 2018
ts.assertNoErrors();
to.assertValue(1);
to.assertComplete();
to.assertNoErrors();
}

@Test(timeout = 5000)
public void startWithObservableError() {
Observable<Object> c = normal.completable
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be o and could be added to the new test class

@codecov
Copy link

codecov bot commented Mar 9, 2018

Codecov Report

Merging #5907 into 2.x will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #5907      +/-   ##
============================================
- Coverage     98.02%   97.99%   -0.04%     
- Complexity     5993     5994       +1     
============================================
  Files           655      655              
  Lines         43928    43928              
  Branches       6086     6086              
============================================
- Hits          43061    43046      -15     
- Misses          254      267      +13     
- Partials        613      615       +2
Impacted Files Coverage Δ Complexity Δ
src/main/java/io/reactivex/Completable.java 100% <100%> (ø) 115 <3> (ø) ⬇️
src/main/java/io/reactivex/Maybe.java 100% <100%> (ø) 171 <3> (ø) ⬇️
...ex/internal/operators/flowable/FlowableReplay.java 94.29% <100%> (+0.21%) 23 <1> (ø) ⬇️
src/main/java/io/reactivex/Single.java 100% <100%> (ø) 142 <3> (ø) ⬇️
src/main/java/io/reactivex/Observable.java 100% <100%> (ø) 535 <3> (ø) ⬇️
...main/java/io/reactivex/observers/TestObserver.java 100% <100%> (ø) 50 <0> (ø) ⬇️
...nternal/operators/observable/ObservableCreate.java 92.17% <0%> (-6.96%) 2% <0%> (ø)
.../io/reactivex/internal/functions/ObjectHelper.java 94.73% <0%> (-5.27%) 20% <0%> (-1%)
...reactivex/internal/operators/single/SingleAmb.java 96.36% <0%> (-3.64%) 9% <0%> (-1%)
...rnal/operators/flowable/FlowableFlatMapSingle.java 92.93% <0%> (-3.27%) 2% <0%> (ø)
... and 32 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f4daa9...cd4f0ef. Read the comment docs.

@akarnokd akarnokd merged commit ab52050 into ReactiveX:2.x Mar 9, 2018
@akarnokd akarnokd deleted the UnitTestCodeQualityChecks branch March 9, 2018 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants