zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Han <h...@apache.org>
Subject Re: maven command to run a specific test in a test case.
Date Fri, 20 Sep 2019 21:51:15 GMT
Thanks Pat. You inspired me and here is another way of running single test:

mvn clean install -DskipTests
mvn test -Dtest=CreateTest#testCreate -pl zookeeper-server

I think the problem I had was I did not specify the module of the test.
Some module does not have test (like zookeeper-doc), so either we have to
skip these module (via -DfailIfNoTests=false), or specify the module (via
-pl module).

On Fri, Sep 20, 2019 at 2:44 PM Patrick Hunt <phunt@apache.org> wrote:

> the following works fine for me and runs the specified test (passes)
>
> $ mvn clean install -DskipTests
> $ mvn test -Dtest=UnifiedServerSocketTest -pl zookeeper-server
>
> [INFO] Tests run: 72, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
> 8.178 s - in org.apache.zookeeper.server.quorum.UnifiedServerSocketTest
>
> ⌂76% [phunt:~/dev/zookeeper-trunk] master+ 2s 1 ± mvn -v
> Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117;
> 2019-08-27T08:06:16-07:00)
> Maven home: /usr/local/Cellar/maven/3.6.2/libexec
> Java version: 1.8.0_222, vendor: AdoptOpenJDK, runtime:
> /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
>
> Patrick
>
>
> On Fri, Sep 20, 2019 at 2:27 PM Michael Han <hanm@apache.org> wrote:
>
> > Thanks Andor, I tried that before but got some errors (still trying to
> > figure out what those errors mean). Any chance you can have a concrete
> > canonical example that execute a real single test via maven?
> >
> > On a side note, "mvn test" works for me which ran all tests, when
> executed
> > under root zookeeper folder.
> >
> > On Fri, Sep 20, 2019 at 2:11 PM Andor Molnar <andor@cloudera.com.invalid
> >
> > wrote:
> >
> > > Even better to do a quick google search:
> > >
> > >
> > >
> >
> https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html
> > >
> > > mvn -Dtest=TestCircle#mytest test
> > >
> > > Andor
> > >
> > > On Fri, Sep 20, 2019 at 11:08 PM Andor Molnar <andor@cloudera.com>
> > wrote:
> > >
> > > > I usually use:
> > > >
> > > > mvn verify -Dtest=bar
> > > >
> > > > Which runs the entire testcase. Not sure about how to run single test
> > > > method.
> > > >
> > > > Andor
> > > >
> > > >
> > > >
> > > > On Fri, Sep 20, 2019 at 11:05 PM Michael Han <hanm@apache.org>
> wrote:
> > > >
> > > >> In ant, we can execute a single test "foo" in a test case "bar" like
> > > this:
> > > >>
> > > >> *ant -Dtestcase=bar -Dtest.method=foo*
> > > >>
> > > >> What's the corresponding maven command?
> > > >>
> > > >> Cheers
> > > >> Michael.
> > > >>
> > > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message