Skip to content

3.x: Have all unit tests extend a base test class #6583

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

Closed
akarnokd opened this issue Jul 22, 2019 · 5 comments
Closed

3.x: Have all unit tests extend a base test class #6583

akarnokd opened this issue Jul 22, 2019 · 5 comments

Comments

@akarnokd
Copy link
Member

By adding a common base class, we can enable a "global" timeout and a per-class log output that prevents Travis CI to stop the build and also not flood the log with all methods:

package io.reactivex.testsupport;

public abstract class RxJavaTest {
  @Rule
  protected Timeout globalTimeout = new Timeout(5, TimeUnit.MINUTES);

  @Test
  @Ignore
  public final void announce() {
  }
}

This way, we no longer have to rely on the random ignores scattered along the codebase. This baseclass-ignore may seem unnecessarily complicated, but unfortunately, I was unable to create a working setting via Gradle's test runner.

@akarnokd akarnokd added this to the 3.0 milestone Jul 22, 2019
@RomanWuattier
Copy link
Contributor

Hey, I see the interest having a global timeout in a base class. Please note that in Junit4, the timeout parameter on @Test annotation does not override the Timeout Rule. This can be an issue when a test requires a custom timeout.
Also, I don't understand the announce test. Do you expect every ignored test to be transferred in the class RxJavaTest?

@akarnokd
Copy link
Member Author

No problem, default 2-5 minutes should work. Travis kills the build if no standard output is happening for 10 minutes. Announce should create a log print often. Ignore should be reevaluated in place and deleted if no longer needed.

@RomanWuattier
Copy link
Contributor

Thanks, I'll submit a PR.

RomanWuattier added a commit to RomanWuattier/RxJava that referenced this issue Jul 24, 2019
This commit creates the `RxJavaTest` class defining a default
timeout to 5 minutes. An ignored test announce itself for each
running class extending it preventing Travis CI from killing the
build.

Have `Completable` tests extend from `RxJavaTest`.
Have `Disposable` tests extend from `RxJavaTest`.
Have `Exception` tests extend from `RxJavaTest`

Closes: ReactiveX#6583
RomanWuattier added a commit to RomanWuattier/RxJava that referenced this issue Jul 24, 2019
This commit creates the `RxJavaTest` class defining a default
timeout to 5 minutes. An ignored test announce itself for each
running class extending it preventing Travis CI from killing the
build.

Have `Completable` tests extend from `RxJavaTest`.
Have `Disposable` tests extend from `RxJavaTest`.
Have `Exception` tests extend from `RxJavaTest`

Related: ReactiveX#6583
RomanWuattier added a commit to RomanWuattier/RxJava that referenced this issue Jul 25, 2019
This commit creates the `RxJavaTest` class defining a default
timeout to 5 minutes. An ignored test announce itself for each
running class extending it preventing Travis CI from killing the
build.

Have `Completable` tests extend from `RxJavaTest`.
Have `Disposable` tests extend from `RxJavaTest`.
Have `Exception` tests extend from `RxJavaTest`

Related: ReactiveX#6583
akarnokd pushed a commit that referenced this issue Jul 26, 2019
This commit creates the `RxJavaTest` class defining a default
timeout to 5 minutes. An ignored test announce itself for each
running class extending it preventing Travis CI from killing the
build.

Have `Completable` tests extend from `RxJavaTest`.
Have `Disposable` tests extend from `RxJavaTest`.
Have `Exception` tests extend from `RxJavaTest`

Related: #6583
RomanWuattier added a commit to RomanWuattier/RxJava that referenced this issue Jul 27, 2019
This commit updates the unit tests of the following operators:
* flowable
* maybe
* observable
* disposable
* observer
* parallel
* processors
* schedulers

and RxJava plugin.

Related: ReactiveX#6583
RomanWuattier added a commit to RomanWuattier/RxJava that referenced this issue Jul 27, 2019
This commit updates the unit tests of the following operators:
* flowable
* maybe
* observable
* disposable
* observer
* parallel
* processors
* schedulers

and RxJava plugin.

Related: ReactiveX#6583
akarnokd pushed a commit that referenced this issue Jul 28, 2019
This commit updates the unit tests of the following operators:
* flowable
* maybe
* observable
* disposable
* observer
* parallel
* processors
* schedulers

and RxJava plugin.

Related: #6583
RomanWuattier added a commit to RomanWuattier/RxJava that referenced this issue Jul 28, 2019
This commit updates the unit tests of the following operators:
* single
* subjects
* subscribers
And for internal operators:
* internal.disposable
* internal.fuctions
* internal.observers
* internal.queue
* interanl.schedulers
* internal.subscribers
* internal.subscriptions
* internal.operator.completable

Related: ReactiveX#6583
akarnokd pushed a commit that referenced this issue Jul 29, 2019
This commit updates the unit tests of the following operators:
* single
* subjects
* subscribers
And for internal operators:
* internal.disposable
* internal.fuctions
* internal.observers
* internal.queue
* interanl.schedulers
* internal.subscribers
* internal.subscriptions
* internal.operator.completable

Related: #6583
RomanWuattier added a commit to RomanWuattier/RxJava that referenced this issue Jul 30, 2019
This commit updates the unit tests for `internal.operator.flowable`

Related: ReactiveX#6583
RomanWuattier added a commit to RomanWuattier/RxJava that referenced this issue Jul 30, 2019
This commit updates the unit tests for `internal.operator.flowable`

Related: ReactiveX#6583
akarnokd pushed a commit that referenced this issue Jul 30, 2019
…#6600)

This commit updates the unit tests for `internal.operator.flowable`

Related: #6583
RomanWuattier added a commit to RomanWuattier/RxJava that referenced this issue Jul 30, 2019
This commit updates the unit tests of the following operators:
* internal.operators.maybe
* internal.operator.mixed
* internal.operator.single

Related: ReactiveX#6583
akarnokd pushed a commit that referenced this issue Jul 31, 2019
This commit updates the unit tests of the following operators:
* internal.operators.maybe
* internal.operator.mixed
* internal.operator.single

Related: #6583
RomanWuattier added a commit to RomanWuattier/RxJava that referenced this issue Aug 2, 2019
…st` - 6

This commit updates the unit tests for `internal.operator.observable`

Related: ReactiveX#6583
akarnokd pushed a commit that referenced this issue Aug 3, 2019
…st` - 6 (#6607)

This commit updates the unit tests for `internal.operator.observable`

Related: #6583
@RomanWuattier
Copy link
Contributor

@akarnokd
Copy link
Member Author

akarnokd commented Aug 4, 2019

Don't worry about them. Thanks for your diligent work!

@akarnokd akarnokd closed this as completed Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants