2017-02-23 10 views
0

Robotframework에서 작성한 테스트 세트를 Maven으로 실행하려고합니다.이 코드는 유닛 및 통합 테스트 단계에서 다루는 전반적인 코드를 캡처하고자하므로 jacoco 플러그인.로봇 테스트를 실행하는 동안 필요한 라이브러리에 대한 Maven 빌드가 실패합니다.

모두는 requests, 그것은 로봇 시험을 수행하기 시작하지만 SSHLibrary과 같은 몇 가지 테스트 라이브러리를 가져하지 않는, 좋아 보인다 jsonschema 등 난에 대한 클래스 경로에 항아리를 추가 할 수있을 것이라는 점을 알게

이러한 종속성은 아래 로그에서 SSHLibrary에 대해 com.trilead.ssh2을 참조하십시오.

--- robotframework-maven-plugin:1.4.7:acceptance-test (default) @ rdx --- 
Executing Robot with command: 
[/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java, -javaagent:/home/asr/.m2/repository/org/jacoco/org.jacoco.agent/0.7.5.201505241946/org.jacoco.agent-0.7.5.201505241946-runtime.jar=destfile=/home/asr/workspace/RDX/target/coverage-reports/jacoco-it.exec, org.robotframework.RobotFramework, -d, /home/asr/workspace/RDX/target/robotframework-reports, -t, mycli_help_usage, -V, /home/asr/robot/tf2jan/etc/environments/mycli_env.py, -P, /home/asr/workspace/RDX/src/test/resources/robotframework/libraries, -x, TEST-mycli.xml, --xunitskipnoncritical, /home/asr/robot/tf2jan/Tests/CLI/mycli] 
============================================================================== 
mycli                   
============================================================================== 
[ ERROR ] Error in file '/home/asr/robot/tf2jan/Tests/CLI/mycli/mycli_resources.txt': Importing test library 'SSHLibrary' failed: ImportError: No module named SSHLibrary 
Traceback (most recent call last): 
    None 
PYTHONPATH: 
    /home/asr/.m2/repository/org/robotframework/robotframework/3.0.2/Lib 
    /home/asr/.m2/repository/org/robotframework/robotframework/3.0.2/robotframework-3.0.2.jar/Lib 
    __classpath__ 
    __pyclasspath__/ 
CLASSPATH: 
    /home/asr/.m2/repository/org/robotframework/robotframework/3.0.2/robotframework-3.0.2.jar 
    /home/asr/workspace/RDX/target/test-classes 
    /home/asr/workspace/RDX/target/classes 
    /home/asr/.m2/repository/com/trilead/trilead-ssh2/build213-svnkit-1.3-patch/trilead-ssh2-build213-svnkit-1.3-patch.jar 
    /home/asr/.m2/repository/junit/junit/4.11/junit-4.11.jar 
    /home/asr/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar 
    /home/asr/.m2/repository/pl/pragmatists/JUnitParams/1.0.4/JUnitParams-1.0.4.jar 
/home/asr/.m2/repository/org/jacoco/org.jacoco.agent/0.7.5.201505241946/org.jacoco.agent-0.7.5.201505241946-runtime.jar 

답변

0

extraPathDirectory 태그는 아래를 참조하여 경로에 필요한 파이썬 라이브러리를 추가하여이 문제를 해결 : 링크를 점검, 어쩌면 당신은 적절하고 유용한 아무것도 찾을 수 있습니다.

<plugin> 
              <groupId>org.robotframework</groupId> 
              <artifactId>robotframework-maven-plugin</artifactId> 
              <version>1.4.7</version> 
              <executions> 
                <execution> 
                  <goals> 
                    <goal>acceptance-test</goal> 
                    <goal>verify</goal> 
                  </goals> 
                  <configuration> 
                    <skip>${skipRobotTests}</skip> 
                    <testCasesDirectory>/home/asr/robot/tf2jan/Tests/CLI/dtcli</testCasesDirectory> 
                    <variableFiles>/home/asr/robot/tf2jan/etc/environments/dtcli_env.py</variableFiles> 
                    <outputDirectory>${project.basedir}/target/robotframework-reports/</outputDirectory> 
                    <tests>dtcli_help_usage</tests> 
                    <extraPathDirectories> 
                     <extraPathDirectory>/usr/lib/python2.7/dist-packages</extraPathDirectory> 
                      <extraPathDirectory>/home/asr/Downloads/python-jsonpath-rw</extraPathDirectory> 
                      <extraPathDirectory>/home/asr/Downloads/ply-3.10</extraPathDirectory> 
                      <extraPathDirectory>/home/asr/Downloads/jsonselect-0.2.3</extraPathDirectory> 
                    </extraPathDirectories> 
                    <externalRunner> 
                      <excludeDependencies>false</excludeDependencies> 
                      <jvmArgs> 
                        <jvmArg>${surefireArgLine}</jvmArg> 
                      </jvmArgs> 
                    </externalRunner> 
                  </configuration> 
                </execution> 
              </executions> 
            </plugin>