遇一山,过一山,处处有风景;只要勇敢向前,一路尽是繁花盛开。 | (点击查看→)【测试干货】python/java自动化、持续集成、性能、测开、简历、笔试面试等

企业级持续集成实战系列(15):持续集成踩坑汇总

 

本系列汇总,请查看这里https://www.cnblogs.com/uncleyong/p/16721826.html

说明

包含前期调试遇到的问题

 

问题一:idea中,命令执行testng.xml,报错

Please refer to D:\myjava\apiAutoTest\target\surefire-reports for the individual test results.

 

忽略test的错误,断言失败也继续构建,加参数:-Dmaven.test.failure.ignore=true

【bak】

 

问题二:无法连接仓库:Host key verification failed.

无法连接仓库:Command "git ls-remote -h git@192.168.117.180:qzcsbj/gift.git HEAD" returned status code 128:
stdout:
stderr: No ECDSA host key is known for 192.168.117.180 and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 

找到不能ssh登录的IP, 然后将IP对应的public key 删除:vim ~/.ssh/known_hosts

【bak】

 

问题三:权限不足

 

cd /usr/local/apache-maven-3.6.1

chmod 777 -R myRep/

 

问题四:k8s中下载jar包失败

改为阿里云镜像源

 

 

从容器拷贝配置文件到虚拟机

docker cp 9b7d8de426fc:/usr/share/maven/conf/settings.xml ./

添加阿里云镜像地址:vim settings.xml

    <mirror>
        <id>aliyun</id>
        <mirrorOf>*</mirrorOf>
        <name>aliyun maven</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    </mirror>

 

创建cm:kubectl create configmap maven-k8s --from-file=settings.xml

 

Jenkinsfile中volumes下添加如下内容:

  volumes:
    - name: "dockersock"
      hostPath:
        path: "/var/run/docker.sock"
    - name: "localtime"
      hostPath:
        path: "/usr/share/zoneinfo/Asia/Shanghai"
    - name: maven-k8s
      configMap:
        name: maven-k8s
        items:
          - key: settings.xml
            path: settings.xml

 

问题五:java.nio.file.AccessDeniedException: /home/jenkins/agent/workspace/gift/target/allure-results/testrun.json

 

https://www.cnblogs.com/uncleyong/p/16718719.html

 

问题六:hudson.plugins.git.GitException: Failed to delete workspace

 

https://www.cnblogs.com/uncleyong/p/17838934.html

 

posted @ 2022-09-22 22:49  全栈测试笔记  阅读(595)  评论(0编辑  收藏  举报
浏览器标题切换
浏览器标题切换end