2016-10-06 3 views
0

최신 버전을 사용하고 있습니다. source code here입니다. 병렬로 내 스위트를 실행하려고 다음과 같은 구성을 사용하여 :Scalatest maven plugin : 오류 : -c는 오랫동안 사용되지 않으며 더 이상 지원되지 않습니다.

<build><plugin> 
    <groupId>org.scalatest</groupId> 
    <artifactId>scalatest-maven-plugin</artifactId> 
    <version>1.0</version> 
    <configuration> 
     <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory> 
     <junitxml>.</junitxml> 
     <filereports>WDF TestSuite.txt</filereports> 
     <htmlreporters>${project.build.directory}/html/scalatest</htmlreporters>      
     <parallel>true</parallel> 
    </configuration> 
    <executions> 
     <execution> 
      <id>test</id> 
      <goals> 
       <goal>test</goal> 
      </goals> 
     </execution> 
    </executions> 
</plugin></build> 

가 리드를 메이븐 오류 구축 다음

[INFO] 
[INFO] --- scalatest-maven-plugin:1.0:test (test) @ myproject --- 
Exception in thread "ScalaTest-main" java.lang.IllegalArgumentException: ERROR: -c has been deprecated for a very long time and is no longer supported, to prepare for reusing it for a different purpos 
e in the near future. Please change all uses of -c to -P. 
     at org.scalatest.tools.ArgsParser$.checkArgsForValidity(ArgsParser.scala:46) 
     at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:857) 
     at org.scalatest.tools.Runner$.main(Runner.scala:827) 
     at org.scalatest.tools.Runner.main(Runner.scala) 

는 기본적으로 scalatest - 받는다는 - 플러그인 대신 scalatest CLI에 -c 전달됩니다 올바른 -P .. 또는 더 나은 -P10 즉 사용할 스레드 수.

-P10을 Maven을 통해 Scatest 프로세스에 전달할 수 있습니까? MAVEN_OPTS 환경 변수 또는 Maven CLI에서 직접 설정을 시도했지만 선택되지 않았습니다.

나는이 같은 scalatest - 받는다는 - 플러그인을 구성 시도 : 너무 실패 있도록

<configuration> 
    <argLine>-P10</argLine> 
</configuration> 

그러나이 매개 변수는 Scalatest에 자바 프로세스에 전달되지 않습니다.

답변

1

my own fork of the scalatest-maven-plugin을 만들어 병렬 문제를 해결하고 1.1-SNAPSHOT으로 버전을 지정했습니다. 빌드 등을 모두 고쳐야했습니다. 모두 부러졌습니다. I는이어서 scalatest-maven-plugin_1.1-SNAPSHOT.tar.gz

그것을 테스트하는 직접 컴파일 다운로드 타르 버전을 포함 my own fork of the scalatest-maven-plugin 사용 my own version of a scala-maven-example 갈래 각 제품군의 첫 번째 테스트를 실행 각 제품군 및 스레드 ID로드 스레드 ID를 표시 scalatest 샘플 코드를 수정 . 또한 각각의 점에서 현재 스레드가 10 초 동안 임의의 시간 동안 잠자기 상태가되는지 확인합니다. 모든 스카 테스트 스위트는 단일 스레드에 의해로드되고 병렬이 활성화 된 경우 병렬로 실행됩니다.

<parallel>false</parallel>을 이용한 결과이다

[INFO] --- scalatest-maven-plugin:1.1-SNAPSHOT:test (test) @ scala-maven-testing --- 
Discovery starting. 
** loading 'net.lockney.AcceptanceTest' Suite with ThreadId=1 
==> executing 'Simple thing state' test with ThreadId=1 
** loading 'net.lockney.MatcherExampleSuite' Suite with ThreadId=1 
** loading 'net.lockney.SimpleSpec' Suite with ThreadId=1 
** loading 'net.lockney.SimpleSuite' Suite with ThreadId=1 
Discovery completed in 19 seconds, 98 milliseconds. 
Run starting. Expected test count is: 8 
AcceptanceTest: 
As a user 
I want to be able to create a simple thing and implicitly start it 
So that I can then turn it off 
And see that it is stopped 
Feature: Simple thing state 
    Scenario: User stops thing when it's already on 
    Given An initialized thing, that has not been started 
    When User stops it again 
    Then We should see that it is stopped 
==> executing 'equality' test with ThreadId=1 
MatcherExampleSuite: 
- equality 
==> executing 'SimpleObject' should 'accept a String' test with ThreadId=1 
- string matchers *** FAILED *** 
    "something" did not end with substring "some" (MatcherExampleSuite.scala:29) 
SimpleSpec: 
SimpleObject 
- should accept a String 
- should even accept really long Strings 
==> executing 'An empty Set should have size 0' test with ThreadId=1 
... 
Run completed in 28 seconds, 300 milliseconds. 
Total number of tests run: 8 
Suites: completed 5, aborted 0 
Tests: succeeded 6, failed 2, canceled 0, ignored 0, pending 0 
*** 2 TESTS FAILED *** 

이는 <parallel>true</parallel><parallelThreads>10</parallelThreads>를 이용한 결과이다

[INFO] --- scalatest-maven-plugin:1.1-SNAPSHOT:test (test) @ scala-maven-testing --- 
Discovery starting. 
** loading 'net.lockney.AcceptanceTest' Suite with ThreadId=1 
==> executing 'Simple thing state' test with ThreadId=1 
** loading 'net.lockney.MatcherExampleSuite' Suite with ThreadId=1 
** loading 'net.lockney.SimpleSpec' Suite with ThreadId=1 
** loading 'net.lockney.SimpleSuite' Suite with ThreadId=1 
Discovery completed in 30 seconds, 904 milliseconds. 
Run starting. Expected test count is: 8 
MatcherExampleSuite: 
SimpleSuite: 
AcceptanceTest: 
SimpleSpec: 
SimpleObject 
As a user 
I want to be able to create a simple thing and implicitly start it 
So that I can then turn it off 
And see that it is stopped 
Feature: Simple thing state 
==> executing 'An empty Set should have size 0' test with ThreadId=13 
==> executing 'SimpleObject' should 'accept a String' test with ThreadId=12 
==> executing 'equality' test with ThreadId=11 
... 
Run completed in 40 seconds, 706 milliseconds. 
Total number of tests run: 8 
Suites: completed 5, aborted 0 
Tests: succeeded 6, failed 2, canceled 0, ignored 0, pending 0 
*** 2 TESTS FAILED *** 
관련 문제