Git Product home page Git Product logo

kiwi-test's People

Stargazers

Charlee Chitsuk avatar

Watchers

Chris Rohr avatar James Cloos avatar  avatar

Forkers

charleech

kiwi-test's Issues

Add ResetKiwiValidationExtension

This is a JUnit Jupiter extension that resets the singleton Validator instance in kiwi's KiwiValidations class, which may be necessary if there are tests that modify the default validator.

Add ParameterizedTestHelper

May be useful when writing parameterized tests (that don't or can't for some reason use JUnit Jupiter's @ParameterizedTest.

Depends on #67

No tests in DropwizardAppTestsTest run anymore in Travis CI

Just noticed there is (supposedly) 0% coverage on DropwizardAppTestsTest. The reason is because in the Travis CI logs, none of the 14 tests are actually running anymore. I traced the origin of this problem back to the addition of the PostgresAppTestExtension.

In build 109 (before PostgresAppTestExtension was added), all 14 tests in DropwizardAppTestsTest run and the coverage is 98.2%. The logs show:

[INFO] Running org.kiwiproject.test.dropwizard.app.DropwizardAppTestsTest
228316:01:28.149 [SessionTracker] INFO  o.a.z.s.SessionTrackerImpl - SessionTrackerImpl exited loop!
2284INFO  [2020-08-17 16:01:29,011] io.dropwizard.server.SimpleServerFactory: Registering jersey handler with root path prefix: /application
2285INFO  [2020-08-17 16:01:29,020] io.dropwizard.server.SimpleServerFactory: Registering admin handler with root path prefix: /admin
2286INFO  [2020-08-17 16:01:29,056] io.dropwizard.server.SimpleServerFactory: Registering jersey handler with root path prefix: /application
2287INFO  [2020-08-17 16:01:29,058] io.dropwizard.server.SimpleServerFactory: Registering admin handler with root path prefix: /admin
2288INFO  [2020-08-17 16:01:29,061] io.dropwizard.server.ServerFactory: Starting App
...
...lots more logging elided...
...
[INFO] Tests run: 14, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.527 s - in org.kiwiproject.test.dropwizard.app.DropwizardAppTestsTest
2309

In build 112 (after PostgresAppTestExtension was added), no tests are run:

[INFO] Running org.kiwiproject.test.dropwizard.app.DropwizardAppTestsTest
2399[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.07 s - in org.kiwiproject.test.dropwizard.app.DropwizardAppTestsTest

The PostgresAppTestExtensionTest is run in build 112 immediately before DropwizardAppTestsTest, so I am guessing that something is happening that screws up the Dropwizard extension mechanism, but I have no idea what it could possibly be...

Links to builds:

109 - https://travis-ci.com/github/kiwiproject/kiwi-test/builds/179993436

112 - https://travis-ci.com/github/kiwiproject/kiwi-test/builds/181572334

AddJaxrsTestHelper

Note: the original class name was JaxRsTestHelper but to be consistent with all the other JaxrsXxx classes in kiwi and in kiwi-test, we are renaming to JaxrsTestHelper

Figure out "best" way to re-enable PostgresAppTestExtensionTest on macOS

Fix build and/or provide instructions so that PostgresAppTestExtensionTest works on Mac OS both running via Maven and IntelliJ.

Solution seems to just be setting the LC_XXX environment vars:

export LC_CTYPE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"

Which presumably we can do in the Maven POM.

Related to this:

Add badge for javadoc.io

[![javadoc](https://javadoc.io/badge2/org.kiwiproject/kiwi-test/javadoc.svg)](https://javadoc.io/doc/org.kiwiproject/kiwi-test)

Consider adding a Fixtures class that returns a test resource as a Path

Instead of just always returning the content of the test fixture like Dropwizard's FixtureHelpers, provide a test utility to return the Path of a given test resource.

For example:

var path = Fixtures.fixturePath("ansible-vault/secret.txt");  // the returned type is java.nio.file.Path

Could consider also adding a second method to return a File, e.g.:

var file = Fixtures.fixtureFile("ansible-vault/secret.txt");  // the returned type is java.io.File

Of course, you can simply convert a Path to a File using the toFile() method, so that might not be worth much.

Migrate StandardExceptionTests utility from dropwizard-curator

Migrate the StandardExceptionTests test utility from dropwizard-curator.

  1. Add it here (in kiwi-test)
  2. Once in Maven central, update dropwizard-curator and dropwizard-leader-latch to use it
  3. Remove from dropwizard-curator
  4. Remove from dropwizard-leader-latch (I copied it there today since it isn't yet in kiwi-test)

Update Curator and Zookeeper versions

We are on really old versions of both Curator (2.13.0) and Zookeeper (3.4.13 3.4.14)

The most recent versions are:

  • Curator: 5.1.0 (this uses Zookeeper 3.6.0)
  • Zookeeper: 3.6.1

We probably cannot update these until we update the Zookeeper servers, however!

Add ServiceNames utility

Currently this is very specific to our Dropwizard services and how we name them, i.e. ending with -service or -emulator. It also contains only static methods.

We can make this a bit more generic by changing from static methods to instance methods, and having a bit of configurability, e.g. in constructor arguments, or maybe as a (Lombok) builder.

Ensure CuratorTestingServerExtension can handle multiple @Nested class in JUnit Jupiter tests

If there is more than one @Nested test class in a Jupiter test, then the extension closes the CuratorFramework and TetstingServer after the first @Nested class. Then when the second @Nested class is started, the extension's beforeAll throws an exception saying that the client cannot be started again.

The beforeAll currently checks if the client state is STARTED and simple returns if it is. But we also need to check if the state is STOPPED and if so, we need to completely reset the CuratorFramework and TestingServer, basically by creating new instances and calling start() on them. This will ensure that multiple @Nested classes can work properly within one overall test class.

Update to kiwi 0.8.0

Wait until kiwi 0.8.0 is released, then update and remove the exclusions in the kiwi dependency in the POM.

Add DropwizardAppTests

Includes test utility methods for testing Dropwizard apps, i.e. integration tests that use theJUnit Jupiter DropwizardAppExtension

Add WhiteBoxTest meta-annotation

Annotating a test with @WhiteBoxTest indicates a test of some internal implementation detail, e.g. a difficult to simulate exceptional condition.

Use kiwi-parent as parent POM

Because some of the compile-time dependencies in kiwi-test free actually things like AssertJ, JUnit, etc. which are normally test scope, we will need to make sure to override these from the parent and set the scope to compile (I think that's what we want anyway). The version should still be inherited. The dependencies that should not be test scope must be explicitly declared with the appropriate scope (provided), and must declare the version (though they can use the version properties inherited from kiwi-parent).

Add ParameterizedTests

Simple utility that contains (currently) only one method that may be useful when writing parametrized tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.