未验证 提交 94dd6c71 编写于 作者: D dependabot-preview[bot] 提交者: GitHub

Bump github.com/spf13/cobra from 0.0.5 to 0.0.6 (#332)

* Bump github.com/spf13/cobra from 0.0.5 to 0.0.6

Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 0.0.5 to 0.0.6.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/0.0.5...v0.0.6)
Signed-off-by: Ndependabot-preview[bot] <support@dependabot.com>

* Remove slash from git branch name

* Fix the unit test error due to dep bump

* Try not give any params

* Comment the unused code lines
Co-authored-by: LinuxSuRen's avatarZhao Xiaojie <rick@jenkins-zh.cn>
上级 f579c531
......@@ -20,10 +20,12 @@ script:
- make clean go-bindata-download-linux tools init test
# And finally run the SonarQube analysis - read the "sonar-project.properties"
# file to see the specific configuration
- curl -LsS https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip > sonar-scanner-cli-4.0.0.1744-linux.zip
- unzip sonar-scanner-cli-4.0.0.1744-linux.zip
- export branch=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo pr-$TRAVIS_PULL_REQUEST; fi)
- sonar-scanner-4.0.0.1744-linux/bin/sonar-scanner -Dsonar.branch.name=$branch -Dsonar.projectKey=jenkins-zh_jenkins-cli -Dsonar.organization=jenkins-zh -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=674e187e300edc0ad56a05705bd0b21cbe18bd52
# - curl -LsS https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip > sonar-scanner-cli-4.0.0.1744-linux.zip
# - unzip sonar-scanner-cli-4.0.0.1744-linux.zip
# - export branch=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo pr-$TRAVIS_PULL_REQUEST; fi)
# - branch=$(echo $branch | sed 's/\//-/g')
- sonar-scanner
# - sonar-scanner-4.0.0.1744-linux/bin/sonar-scanner -Dsonar.branch.name=$branch -Dsonar.projectKey=jenkins-zh_jenkins-cli -Dsonar.organization=jenkins-zh -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=674e187e300edc0ad56a05705bd0b21cbe18bd52
# it's bad, but no better solution for now
# - sleep 30
# - if [ 'OK' != $(curl -s "https://sonarcloud.io/api/qualitygates/project_status?branch=$branch&projectKey=jenkins-zh_jenkins-cli" | python -c "import sys, json; print(json.load(sys.stdin)['projectStatus']['status'])") ]; then exit -1; fi
......@@ -37,14 +37,12 @@ var _ = Describe("queue command", func() {
Expect(err).To(BeNil())
rootCmd.SetArgs([]string{"queue"})
//rootCmd.SetHelpFunc(func(cmd *cobra.Command, _ []string) {
// cmd.Print("help")
//})
buf := new(bytes.Buffer)
rootCmd.SetOutput(buf)
_, err = rootCmd.ExecuteC()
Expect(err).To(BeNil())
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(Equal("subcommand is required"))
Expect(buf.String()).To(ContainSubstring("Manage the queue of your Jenkins"))
})
......
......@@ -277,7 +277,8 @@ var _ = Describe("Root cmd test", func() {
rootCmd.SetArgs([]string{"--jenkins", "yourServer", "--configFile", configFile.Name()})
_, err = rootCmd.ExecuteC()
Expect(err).NotTo(HaveOccurred())
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(Equal("subcommand is required"))
Expect(buf.String()).To(ContainSubstring("jcli is Jenkins CLI which could help with your multiple Jenkins"))
})
})
......@@ -299,7 +300,8 @@ var _ = Describe("Root cmd test", func() {
rootCmd.SetArgs([]string{"--configFile", "fake", "--url", "fake-url",
"--username", "fake-user", "--token", "fake-token"})
_, err = rootCmd.ExecuteC()
Expect(err).NotTo(HaveOccurred())
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(Equal("subcommand is required"))
jenkins := getCurrentJenkinsFromOptions()
Expect(jenkins.URL).To(Equal("fake-url"))
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册