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

禅道设置通过git tag触发jenkins构建,但实际结果根据后台定时任务每5分钟触发一次构建,并没有按照tag的方式触发 #56

Closed
jjxxff2000 opened this issue Jun 17, 2020 · 1 comment

Comments

@jjxxff2000
Copy link

  • git版本库禅道配置
    8~K0$VC 9AI84_@8KJVZ0GD

  • git触发jenkins任务构建配置
    LAV7N92@TH`HQZ67I5NIRRT

  • 后台计划任务显示正常
    ZN2(A@KRM7@ }S}~OPMK_7A

  • 实际结果并未按照git tag触发构建,而是每5分钟触发一次
    AFZCLR PW1GEJ(@53)K65B5

  • 同时jenkins任务构建失败
    Started by user jiaxuefeng
    Running as SYSTEM
    Building on master in workspace E:\fengfeng\work_tools\MyJenkinsWorkSpace\workspace\ZTF-TestNg-Git
    [WS-CLEANUP] Deleting project workspace...
    [WS-CLEANUP] Deferred wipeout is used...
    [WS-CLEANUP] Done
    No credentials specified
    Cloning the remote Git repository
    Cloning repository https://gitee.com/jjxff2000/ci_test_testng.git

git.exe init E:\fengfeng\work_tools\MyJenkinsWorkSpace\workspace\ZTF-TestNg-Git # timeout=10
Fetching upstream changes from https://gitee.com/jjxff2000/ci_test_testng.git
git.exe --version # timeout=10
git.exe fetch --tags --force --progress https://gitee.com/jjxff2000/ci_test_testng.git +refs/heads/:refs/remotes/origin/
git.exe config remote.origin.url https://gitee.com/jjxff2000/ci_test_testng.git # timeout=10
git.exe config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10
git.exe config remote.origin.url https://gitee.com/jjxff2000/ci_test_testng.git # timeout=10
Fetching upstream changes from https://gitee.com/jjxff2000/ci_test_testng.git
git.exe fetch --tags --force --progress https://gitee.com/jjxff2000/ci_test_testng.git +refs/heads/:refs/remotes/origin/
git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision 78df1cdaed6a72c413f798d882e1d635aa46f352 (refs/remotes/origin/master)
git.exe config core.sparsecheckout # timeout=10
git.exe checkout -f 78df1cdaed6a72c413f798d882e1d635aa46f352
Commit message: "update pom.xml. for zentao0.4"
git.exe rev-list --no-walk 78df1cdaed6a72c413f798d882e1d635aa46f352 # timeout=10
[ZTF-TestNg-Git] $ cmd /c call C:\Users\ADMINI~1\AppData\Local\Temp\jenkins132678985567278885.bat

E:\fengfeng\work_tools\MyJenkinsWorkSpace\workspace\ZTF-TestNg-Git>echo
ECHO 处于打开状态。

E:\fengfeng\work_tools\MyJenkinsWorkSpace\workspace\ZTF-TestNg-Git>exit 0
[ZTF-TestNg-Git] $ cmd /c call C:\Users\ADMINI~1\AppData\Local\Temp\jenkins3844686234650660713.bat

E:\fengfeng\work_tools\MyJenkinsWorkSpace\workspace\ZTF-TestNg-Git>ztf.exe testng -p 001 mvn clean package test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< com.ngtesting.ci:ci_test_testng >-------------------
[INFO] Building ci_test_testng 0.4-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ ci_test_testng ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ci_test_testng ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\fengfeng\work_tools\MyJenkinsWorkSpace\workspace\ZTF-TestNg-Git\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ ci_test_testng ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to E:\fengfeng\work_tools\MyJenkinsWorkSpace\workspace\ZTF-TestNg-Git\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ci_test_testng ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ ci_test_testng ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to E:\fengfeng\work_tools\MyJenkinsWorkSpace\workspace\ZTF-TestNg-Git\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ ci_test_testng ---
[INFO] Surefire report directory: E:\fengfeng\work_tools\MyJenkinsWorkSpace\workspace\ZTF-TestNg-Git\target\surefire-reports


T E S T S

Running com.ngtesting.autotest.test.TestLogin
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@6d86b085
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.488 sec

Results :

Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ ci_test_testng ---
[INFO] Building jar: E:\fengfeng\work_tools\MyJenkinsWorkSpace\workspace\ZTF-TestNg-Git\target\ci_test_testng-0.4-SNAPSHOT.jar
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ci_test_testng ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\fengfeng\work_tools\MyJenkinsWorkSpace\workspace\ZTF-TestNg-Git\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ ci_test_testng ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ci_test_testng ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ ci_test_testng ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ ci_test_testng ---
[INFO] Skipping execution of surefire because it has already been run for this configuration
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.012 s
[INFO] Finished at: 2020-06-17T10:50:59+08:00
[INFO] ------------------------------------------------------------------------

==================================================================================================================================== 2020-06-17 10:51:00 found_scripts: ===================================================================================================================================
(1/3) pass [com.ngtesting.autotest.test.TestLogin] [1. loginSuccess] (0.041s)
(2/3) pass [com.ngtesting.autotest.test.TestLogin] [2. loginFail] (0.004s)
(3/3) pass [com.ngtesting.autotest.test.TestLogin] [3. loginFail] (0.003s)

2020-06-17 10:51:00 run_scripts
{"env":"windows","testType":"unit","testFrame":"testng","productId":1,"taskId":0,"zentaoData":"compile=137","buildUrl":"http://localhost:9000/job/ZTF-TestNg-Git/13/","pass":3,"fail":0,"skip":0,"total":3,"startTime":1592362240,"endTime":1592362260,"duration":20,"funcResult":null,"unitResult":[{"title":"loginSuccess","testSuite":"com.ngtesting.autotest.test.TestLogin","duration":0.041,"failure":null,"id":1,"status":"pass"},{"title":"loginFail","testSuite":"com.ngtesting.autotest.test.TestLogin","duration":0.004,"failure":null,"id":2,"status":"pass"},{"title":"loginFail","testSuite":"com.ngtesting.autotest.test.TestLogin","duration":0.003,"failure":null,"id":3,"status":"pass"}]}

fail_to_submit_test_result
server_return


10:51:01 Uncaught Error: Call to undefined method compileModel::syncCompileStatus() in E:\fengfeng\tools\zentao\xampp\zentao\module\ci\control.php:115
Stack trace:
#0 E:\fengfeng\tools\zentao\xampp\zentao\framework\base\router.class.php(1712): ci->commitResult()
#1 E:\fengfeng\tools\zentao\xampp\zentao\www\index.php(71): baseRouter->loadModule()
#2 {main}
thrown in E:\fengfeng\tools\zentao\xampp\zentao\module\ci\control.php on line 115 when visiting ci-commitResult-
==================================================================================================================================================== = ====================================================================================================================================================

E:\fengfeng\work_tools\MyJenkinsWorkSpace\workspace\ZTF-TestNg-Git>exit 1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

@easysoft
Copy link
Collaborator

easysoft commented Jan 4, 2021

实时触发需要在git库里面通过hook脚本来触发。禅道只是读取git库里面的修改记录。所以无法做到实时。
可以调整计划任务调度的时间增加实时性。
构建失败需要检查你自己的构建脚本。

@easysoft easysoft closed this as completed Jan 4, 2021
sy-records pushed a commit that referenced this issue Jun 6, 2023
… than execution end.' (#56) from sprint/scx_fixbug35137 into 18.4

Reviewed-on: https://git.zcorp.cc/easycorp/zentaopms/pulls/56
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

1 participant