TLDR
33.125 上先跑一次 CP_Docker
然后 slave1 上,根据 CP_Docker 的参数 ChangeHosts
再发起 RL_CP_OneCase 确认
之后就可以跑 RL_CP_BVT 了
在迁移 Jenkins Job 上碰到的坑
1. Build Lockbox.Birdwing 的时候 没有找到 LB.api 和 LB.qa
1 | [ERROR] Failed to execute goal on project Lockbox.Birdwing: Could not resolve dependencies for project com.ea.eadp.lb.test:Lockbox.Birdwing:jar:490.0-SNAPSHOT: The following artifacts could not be resolved: com.ea.lb:lb.api:jar:5.0.0-SNAPSHOT, com.ea.lb:lb.qa:jar:5.0.0-SNAPSHOT: Failure to find com.ea.lb:lb.api:jar:5.0.0-SNAPSHOT in https://artifactory.citools.ea.com/artifactory/ea-snapshots was cached in the local repository, resolution will not be reattempted until the update interval of nucleus.snapshots has elapsed or updates are forced -> [Help 1] |
需要 build lockbox-sloth 和 build lockbox-qa
于是迁移了这两个 job 到 Testinfra Master 上
同时,root 和 shdev 两个用户的 maven repository 目录不同
2. RL-Customer-Portal-BVT Compilation error
1 | [ERROR] COMPILATION ERROR : |
3. Build Sloth 找不到 POM
1 | [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/shdev/pct/jenkins/workspace/Build_Sloth). Please verify you invoked Maven from the correct directory. -> [Help 1] |
通过 -f
手动指定 pom
4. RL-Customer-Portal-BVT NullPointerException
1 | INFO 2021-11-03 02:57:15 - db.mysql.password.encrypted: ***** |
需要在 /usr/bin/config.key
里写个密钥
5. BVT test 会用 Win 下的 ChromeDriver
-Dwebdriver.chrome.driver=\${path}
手动指定 chrome driver 的目录
6. linux 下 ChromeDriver 不能用 root 执行
1 | org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally. |
导致了 139 个 case 执行两次,每个 case 各失败一次,跳过一次
需要用普通用户执行,而不是 root
因此需要从 master 搬到 slave1 上,那里的 Jenkins 用的不是 root
7. chmod 权限问题
1 | [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.3:single (default) on project lb.app: Failed to create assembly: Error creating assembly archive assembly-copy: chmod exit code was: 1 -> [Help 1] |
1 | [WARNING] chmod: changing permissions of '/home/shdev/local/lockbox-sloth/lb.app/target/lb.app/conf/lb.configuration.data-5.0.0-SNAPSHOT.jar': Operation not permitted |
Master 上 git clone 用的是 root 用户,所以对应的目录用户组也是 root
需要 chown -R
8. Chrome 无法启动
1 | INFO 2021-11-04 04:59:19 - ***Test Skipped*** [CaseName:com.ea.eadp.lb.test.cases.lockbox5.origin.ui.checkout.payments.creditCard.BasicTest#newCreditCardCheckout] [Priority:BVT] [Duration:10] [Status:Enable] [BugNumber:] [Release:Default] [Features:(Origin X) checkout - origin x ui toolkit integration and UX updates] [FailedMessage:] |
ssh 上去是不行的,没有 GUI 的环境
需要 vnc 上去作为 shdev 手动执行命令
9. LB.pin and LB.api compilation error
1 | [ERROR] COMPILATION ERROR : |
1 | [ERROR] Error resolving version for plugin 'com.ea.eadp.lb:dodo.swagger.util' from the repositories [local (/home/shdev/.m2/repository), central (https://artifactory.citools.ea.com/artifactory/ea-releases), snapshots (https://artifactory.citools.ea.com/artifactory/ea-snapshots)]: Plugin not found in any plugin repository -> [Help 1] |
需要确认 maven settings.xml 的 repository 配置
直接用了 master 上的 settings.xml
并且通过 -s
指定这个 xml
10. Post script syntax
remember to double check the correct path to JenkinsFiles
folder
11. Upgrading Jenkins
When upgrading Jenkins from 2.150.2
to 2.303.3
,
I changed jenkins.war
to a new one.
1 | java.lang.IllegalStateException: An attempt to save the global configuration |
Added -Dio.jenkins.plugins.casc.ConfigurationAsCode.initialDelay=20000
to ./start_https_jenkins.sh
Then I copied the entire plugin
folder from testinfra-master
‘s jenkins
And use the jenkins.war
of version 2.222.4
Comments
int 的话,是不用填 nucleus 和 lockbox 的 ip 的
只有在本地跑的时候需要
本地跑的时候,需要 CP 铺好了
也就是跑过一边 CP_Docker 这个 job,铺
在 10.86.33.125 上执行就 ok
这个 job 会触发 BVT 和 INTBVT 之类的 job,跑
对应的参数照道理来讲会自动传过去
但因为 linux 的 Jenkins 没有 trigger other jobs
所以需要手动发起 ChangeHost
ip 也必须一样
ChangeHost 在 slave 1 上依然没法 sudo,用奇妙的办法绕过去了
CP_One_Case 可以用来确认 nucleusIP 那台机器是不是还活着