2013-05-09 4 views
4

Jenkins 및 Sauce Labs와 Magento Test Automation Framework (MTAF)를 구성했으며 모든 것이 잘 작동합니다. 그러나 다중 구성 프로젝트를 만들 때 Jenkins의 작업 구성에서 병렬 실행을 위해 브라우저 목록에서 두 가지 브라우저를 선택했습니다.Jenkins가 MathF가 소스 랩에서 작동하지 않는 다중 구성 프로젝트를 빌드합니다.

빌드를 수행 할 때 Jenkins의 작업 구성에서 브라우저를 선택하는 대신 MTAF 구성 파일 (browser.yaml)에서 브라우저를 가져옵니다.

MTAF의 설정 파일이 아닌 Jenkins의 브라우저를 실행할 수있는 방법이 있습니까?

답변

0

MTAF에는이를 수행 할 수있는 runtests.sh 스크립트가 있습니다. 여러 구성 또는 브라우저를 동시에 실행하려는 경우 스크립트에 매개 변수를 전달할 수 있습니다. 매개 변수를 전달하려면 다음 템플릿을 사용하십시오.

runtests.sh application:browser, application:browser 

여기서 응용 프로그램은 기본 응용 프로그램에 대한 링크 이름입니다 (기본적으로 * mage).

/path/to/script/runtests.sh mage:googlechrome, mage:firefox 

을 그리고 젠킨스 구성에 phpunit을 가치로 사용 :

는이 같은 명령을해야합니다. 이제 다음과 같은 내용이 있습니다 :

<target name="phpunit" description="Run unit tests with PHPUnit"> 
     <exec command="phpunit --configuration=${basedir}/tests/phpunit.xml 
     --log-junit ${basedir}/build/logs/junit.xml 
     --coverage-clover ${basedir}/build/logs/clover.xml 
     --coverage-html ${basedir}/build/coverage"/> 
</target> 

위의 명령으로 변경하면 트릭을 수행해야합니다. 그리고 마지막으로, 당신은

eval exec "/usr/bin/phpunit -c ${phpunitArr[${i}]}/phpunit.xml &" 

이 phpunit을 인수로 줄 수있는 기능 runTest() 및 변경 라인을 찾아,이 모든 phpunit을 인수, 열린 파일 runtests.sh을 유지하려는 경우 :

eval exec "/usr/bin/phpunit -c ${phpunitArr[${i}]}/phpunit.xml --log-junit /path/to/build/logs/junit.xml --coverage-clover /path/to/build/logs/clover.xml &"