【问题标题】:How do I set up a Jenkins CI server to run automated BDD selenium tests using a remote webdriver?如何设置 Jenkins CI 服务器以使用远程 webdriver 运行自动 BDD selenium 测试?
【发布时间】:2017-10-16 04:56:25
【问题描述】:

我是 Jenkins 的新手,正在尝试设置一个服务器以从 GitHub 存储库运行 selenium 测试。我确定我做错了什么,可能有几件事情,但一直无法弄清楚。

我已将 selenium 插件配置为使用默认的 Selenium 集线器端口 4444。

Project GitHub Configuration

无法弄清楚为什么我会收到此错误。凭据与创建的用户名和 ssh 密钥匹配。我什至可以通过单击项目仪表板中的GitHub 来访问存储库。

Project Shell Execution Steps

构建前的执行步骤。这些是我在终端中用来在本地运行测试的命令。

当我构建作业时,它会给出以下日志:

 Started by <user>
 Building in workspace /Users/Shared/Jenkins/Home/workspace/Tutorial
 > git rev-parse --is-inside-work-tree # timeout=10
 Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/<repo address>.git # timeout=10
 Fetching upstream changes from https://github.com/<repo address>.git
 > git --version # timeout=10
 using GIT_SSH to set credentials 
 > git fetch --tags --progress https://github.com/<repo address>.git +refs/heads/*:refs/remotes/origin/*
 ERROR: Error fetching remote repo 'origin'
 hudson.plugins.git.GitException: Failed to fetch from https://github.com/<repo address>.git
 at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:809)
 at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1076)
 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1107)
 at hudson.scm.SCM.checkout(SCM.java:496)
 at hudson.model.AbstractProject.checkout(AbstractProject.java:1281)
 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
 at hudson.model.Run.execute(Run.java:1728)
 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
 at hudson.model.ResourceController.execute(ResourceController.java:98)
 at hudson.model.Executor.run(Executor.java:405)
 Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://github.com/<repo address>.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
 stdout: 
 stderr: remote: Invalid username or password.
 fatal: Authentication failed for 'https://github.com/<repo address>.git/'

 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1877)
 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1596)
 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:348)
 at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:807)
 ... 11 more
 ERROR: null
 Finished: FAILURE

【问题讨论】:

  • 请在问题中输入minimal reproducible example
  • @jonrsharpe 您想要我尝试运行的测试示例吗?什么例子会有帮助?
  • 从它说它无法通过 git 进行身份验证的错误中,所以它是你需要修复的第一件事

标签: python selenium github jenkins remote-server


【解决方案1】:

如果您使用 Jenkins 的 SSH 密钥进行身份验证,请尝试使用 SSH 版本,例如git@github.com:FOO/BAR.git 而不是 HTTPS 之一。

【讨论】:

    猜你喜欢
    • 2012-12-23
    • 1970-01-01
    • 1970-01-01
    • 2016-06-26
    • 1970-01-01
    • 1970-01-01
    • 2013-08-19
    • 1970-01-01
    • 2011-10-07
    相关资源
    最近更新 更多