Skip to content

Commit

Permalink
fix some additional CI issues (#24718)
Browse files Browse the repository at this point in the history
* more ci fixes

* residual lint issues

* skip

* revert

* x

* fml
  • Loading branch information
joshblum authored Dec 4, 2021
1 parent f27ea4f commit 386c026
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 35 deletions.
66 changes: 34 additions & 32 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -357,38 +357,40 @@ def getDiffGoDependencies() {
def getPackagesToTest(dependencyFiles, hasJenkinsfileChanges) {
def packagesToTest = [:]
dir('go') {
if (env.CHANGE_TARGET && !hasJenkinsfileChanges) {
// The Jenkinsfile hasn't changed, so we try to run a minimal set of
// tests to capture the changes in this PR.
fetchChangeTarget()
def diffFileList = getDiffFileList()
def diffPackageList = sh(returnStdout: true, script: "bash -c \"set -o pipefail; echo '${diffFileList}' | grep '^go\\/' | sed 's/^\\(.*\\)\\/[^\\/]*\$/github.com\\/keybase\\/client\\/\\1/' | sort | uniq\"").trim().split()
def diffPackagesAsString = diffPackageList.join(' ')
println "Go packages changed:\n${diffPackagesAsString}"
def diffDependencies = getDiffGoDependencies()
def diffDependenciesAsString = diffDependencies.join(' ')
println "Go dependencies changed:\n${diffDependenciesAsString}"

// Load list of dependencies and mark all dependent packages to test.
def goos = sh(returnStdout: true, script: "go env GOOS").trim()
def dependencyMap = new JsonSlurperClassic().parseText(dependencyFiles[goos])
diffPackageList.each { pkg ->
// pkg changed; we need to load it from dependencyMap to see
// which tests should be run.
dependencyMap[pkg].each { dep, _ ->
packagesToTest[dep] = 1
}
}
diffDependencies.each { pkg ->
// dependency changed; we need to load it from dependencyMap to see
// which tests should be run.
dependencyMap[pkg].each { dep, _ ->
packagesToTest[dep] = 1
}
}
return packagesToTest
}
println "This is a branch build or the Jenkinsfile has changed, so we are running all tests."
// The below has produce a garden variety of errors. Maybe we can re-enable
// it. At some point.
// if (env.CHANGE_TARGET && !hasJenkinsfileChanges) {
// // The Jenkinsfile hasn't changed, so we try to run a minimal set of
// // tests to capture the changes in this PR.
// fetchChangeTarget()
// def diffFileList = getDiffFileList()
// def diffPackageList = sh(returnStdout: true, script: "bash -c \"set -o pipefail; echo '${diffFileList}' | grep '^go\\/' | sed 's/^\\(.*\\)\\/[^\\/]*\$/github.com\\/keybase\\/client\\/\\1/' | sort | uniq\"").trim().split()
// def diffPackagesAsString = diffPackageList.join(' ')
// println "Go packages changed:\n${diffPackagesAsString}"
// def diffDependencies = getDiffGoDependencies()
// def diffDependenciesAsString = diffDependencies.join(' ')
// println "Go dependencies changed:\n${diffDependenciesAsString}"

// // Load list of dependencies and mark all dependent packages to test.
// def goos = sh(returnStdout: true, script: "go env GOOS").trim()
// def dependencyMap = new JsonSlurperClassic().parseText(dependencyFiles[goos])
// diffPackageList.each { pkg ->
// // pkg changed; we need to load it from dependencyMap to see
// // which tests should be run.
// dependencyMap[pkg].each { dep, _ ->
// packagesToTest[dep] = 1
// }
// }
// diffDependencies.each { pkg ->
// // dependency changed; we need to load it from dependencyMap to see
// // which tests should be run.
// dependencyMap[pkg].each { dep, _ ->
// packagesToTest[dep] = 1
// }
// }
// return packagesToTest
//}
//println "This is a branch build or the Jenkinsfile has changed, so we are running all tests."
diffPackageList = sh(returnStdout: true, script: 'go list ./...').trim().split()
// If we get here, just run all the tests in `diffPackageList`
diffPackageList.each { pkg ->
Expand Down
2 changes: 1 addition & 1 deletion go/bind/keybase.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func ReadB64() (res string, err error) {
if err != nil {
// Attempt to fix the connection
if ierr := Reset(); ierr != nil {
fmt.Println("failed to Reset: %v", ierr)
fmt.Printf("failed to Reset: %v\n", ierr)
}
return "", fmt.Errorf("Read error: %s", err)
}
Expand Down
1 change: 1 addition & 0 deletions go/libkb/secret_store_secretservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//go:build linux && !skipkeyringtests
// +build linux,!skipkeyringtests

// nolint:unused
package libkb

import (
Expand Down
2 changes: 1 addition & 1 deletion go/pinentry/pinentry_x11.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ package pinentry
import "os"

func HasWindows() bool {
//If there is a DISPLAY then we can spawn a window to it.
// If there is a DISPLAY then we can spawn a window to it.
return len(os.Getenv("DISPLAY")) > 0
}
2 changes: 1 addition & 1 deletion go/systemd/systemd_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func IsUserSystemdRunning() bool {
// If this is a false positive, user should specify KEYBASE_SYSTEMD=0.
return true
case "":
os.Stderr.WriteString(fmt.Sprintf("Failed to reach user-level systemd daemon.\n"))
os.Stderr.WriteString("Failed to reach user-level systemd daemon.\n")
return false
default:
os.Stderr.WriteString(fmt.Sprintf("Systemd reported an unexpected status: %s\n", outputStr))
Expand Down
1 change: 1 addition & 0 deletions go/systests/multiuser_common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ func (u *smuUser) registerForNotifications() {
}
}

// nolint
func (u *smuUser) waitForNewlyAddedToTeamByID(teamID keybase1.TeamID) {
u.ctx.t.Logf("waiting for newly added to team %s", teamID)

Expand Down

0 comments on commit 386c026

Please sign in to comment.