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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce tests for the Gradle plugin #63

Merged
merged 6 commits into from
Jun 22, 2021

Commits on Jun 22, 2021

  1. Configuration menu
    Copy the full SHA
    60f14e3 View commit details
    Browse the repository at this point in the history
  2. Introduce test infra for the Gradle plugin

    This commit introduces functional tests for the Gradle plugin.
    For now, it's limited to a single test but it will be expanded for
    more use cases. Functional tests are using samples found in the
    `src/samples` directory.
    
    There are 2 test tasks which can be executed, depending on whether
    you want full test coverage or not:
    
    - `functionalTest` will run the test suite on the current version
    of Gradle only
    - `fullFunctionalTest` will do the same, but on all supported Gradle
    versions
    
    To make this possible, the build has been reorganized to leverage
    Gradle composite builds, instead of using the local Maven repository.
    Previously to this, it was necessary to cd into `junit-platform-native`,
    publish to maven Local, then go to the Gradle plugin, build it, and
    test with a local project.
    
    This is no longer required, as now the execution of functional tests
    will _automatically_ trigger the build of the native JUnit project,
    publish the library to a _test_ repository, which in turn is used by
    the functional tests (via repository injection in an init script).
    
    This makes it impossible to make mistakes, or have the build fragile
    if you don't build the `junit-platform-native` first: the dependency
    is now explicit.
    melix committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    b4fc927 View commit details
    Browse the repository at this point in the history
  3. Introduce a functional test for native tests

    That is to say that this test verifies that we can:
    
    - build an image which contains production code and test code
    - execute this image which results in tests being executed
    melix committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    adbb8eb View commit details
    Browse the repository at this point in the history
  4. Inject the JUnit version to tests via system property

    The sample now expects the JUnit version to be injected via a system
    property. This will allow consistent upgrades of libraries without
    having to update the samples themselves.
    melix committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    ab97f0f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    23ea94b View commit details
    Browse the repository at this point in the history
  6. Verify that test and native test results match

    This is really a simple verification at this stage, on the top-level
    test suite only. In particular this is likely not to work for more
    test cases since Gradle would issue one test result file per test,
    while native-test would use a single one.
    melix committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    dfebca4 View commit details
    Browse the repository at this point in the history