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

No runnable methods running as dependency #199

Open
ALekseiMokhov opened this issue Mar 17, 2022 · 2 comments
Open

No runnable methods running as dependency #199

ALekseiMokhov opened this issue Mar 17, 2022 · 2 comments

Comments

@ALekseiMokhov
Copy link

Good day! Got stuck with running liquibase-test-harness in our app. All the time we face the same error:

"org.junit.runners.model.InvalidTestClassError: Invalid test class 'liquibase.harness.data.ChangeDataTests':

  1. No runnable methods
at org.junit.runners.ParentRunner.validate(ParentRunner.java:525)
at org.junit.runners.ParentRunner.<init>(ParentRunner.java:102)
at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:84).." - for all three test classes (minding we extend BaseHarnessSuite).

Our related dependencies:

    <dependency>
        <groupId>org.liquibase</groupId>
        <artifactId>liquibase-test-harness</artifactId>
        <version>1.0.3</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.spockframework</groupId>
        <artifactId>spock-core</artifactId>
        <version>2.1-groovy-3.0</version>
        <scope>test</scope>
    </dependency>
    <dependency> <!-- enables mocking of classes (in addition to interfaces) -->
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
        <version>3.3.0</version>
        <scope>test</scope>
    </dependency>
    <dependency> <!-- enables mocking of classes without default constructor (together with CGLIB) -->
        <groupId>org.objenesis</groupId>
        <artifactId>objenesis</artifactId>
        <version>3.2</version>
        <scope>test</scope>
    </dependency>

I followed README and README.extensions.md trying to configure it.

@KushnirykOleh
Copy link
Contributor

Hi @ALekseiMokhov.
One of issues might be that in test-harness we use spock-core version 1.3-groovy-2.5 and major groovy (and spock) versions are not compatible.
Another thing is harness-config.yml with connection details for your DB might be missing in src\test\resources. Or name of the DB doesn't match with folder names where changesets are present by pattern src/test/resources/liquibase/harness/change/changelogs/{DBname}/{testchangeset}.xml.
Those are few on the top of my head. Also i found that IDEs like Eclipse and Intellij IDEA can recognize and run tests right away, but for command line run it may require more complex configuration of surefire and/or failsafe plugins to recognize and run spock tests

@KushnirykOleh
Copy link
Contributor

https://github.com/liquibase/liquibase-cassandra can be used as an example how to run test-harness tests from other app in terminal.
https://github.com/liquibase/liquibase-cassandra/blob/main/README.test-harness.md has details how to run tests with local docker container. It is a bit outdated as it uses teest-harness 1.0.2, but for 1.0.4 only two additional dependencies are needed - jsonassert and snakeyaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants