-
Notifications
You must be signed in to change notification settings - Fork 41
Cleanup scripts; allow darwin testing #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bfda38a
bin: simplifiy / harmonize scripts
aramprice ad426fd
ci: introduce lint task
aramprice ae5a1dc
Use `tool` directive instead of tools module pattern
aramprice b6cf51b
Cleanup async logger spec
aramprice fa6ef98
Replace call to `nice` with bespoke binary
aramprice 0252e64
Split tests into os-specific files
aramprice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,10 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -eu -o pipefail | ||
|
|
||
| set -e | ||
| ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" | ||
|
|
||
| bin=$(dirname $0) | ||
| ( | ||
| cd "${ROOT_DIR}" | ||
|
|
||
| if [[ "$GOOS" == 'linux' ]] && [[ "$GOARCH" == 'amd64' ]]; then | ||
| export GOTOOLDIR=$(go env GOROOT)/pkg/linux_amd64 | ||
| fi | ||
|
|
||
| CGO_ENABLED=0 go build -o $bin/../out/verify-multidigest github.com/cloudfoundry/bosh-utils/main | ||
| CGO_ENABLED=0 go build -o out/verify-multidigest github.com/cloudfoundry/bosh-utils/main | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -eu -o pipefail | ||
|
|
||
| set -e | ||
| ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" | ||
|
|
||
| export GOARCH=amd64 | ||
| export GOOS=linux | ||
| export GOTOOLDIR=$(go env GOROOT)/pkg/linux_amd64 | ||
|
|
||
| $(dirname $0)/build | ||
| "${ROOT_DIR}/bin/build" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/usr/bin/env bash | ||
| set -eu -o pipefail | ||
|
|
||
| ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" | ||
|
|
||
| go_bin_path="$(go env GOBIN)" | ||
| export PATH=${go_bin_path}:${PATH} | ||
| ( | ||
| cd "${ROOT_DIR}" | ||
| if ! command -v golangci-lint &> /dev/null; then | ||
| echo "Installing golangci-lint@latest..." | ||
| go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest | ||
|
aramprice marked this conversation as resolved.
|
||
| fi | ||
|
|
||
| golangci-lint version | ||
|
aramprice marked this conversation as resolved.
aramprice marked this conversation as resolved.
|
||
|
|
||
| linted_os_list=(linux windows) | ||
|
|
||
| for os in "${linted_os_list[@]}"; do | ||
| echo "lint-ing with GOOS=${os}..." | ||
| GOOS="${os}" golangci-lint run ./... | ||
| done | ||
| ) | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -eu -o pipefail | ||
|
|
||
| set -e | ||
| bin=$(dirname $0) | ||
| ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" | ||
|
|
||
| echo -e "\n Testing packages..." | ||
| go run github.com/onsi/ginkgo/v2/ginkgo run -p -r --race --trace --keep-going "${@}" | ||
| ( | ||
| cd "${ROOT_DIR}" | ||
| go run github.com/onsi/ginkgo/v2/ginkgo run -p -r --race --trace --keep-going ${1+"${@}"} | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -ex | ||
|
|
||
| cd bosh-utils | ||
| bin/lint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| platform: linux | ||
|
|
||
| inputs: | ||
| - name: bosh-utils | ||
|
|
||
| run: | ||
| path: bosh-utils/ci/tasks/lint.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| //go:build !windows | ||
|
|
||
| package main | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "os" | ||
| "runtime" | ||
| "syscall" | ||
| "time" | ||
| ) | ||
|
|
||
| func main() { | ||
| time.Sleep(100 * time.Millisecond) | ||
|
|
||
| pid := os.Getpid() | ||
| niceValue, err := syscall.Getpriority(syscall.PRIO_PROCESS, pid) | ||
|
aramprice marked this conversation as resolved.
|
||
| if err != nil { | ||
| fmt.Printf("error getting priority: %s\n", err) | ||
| os.Exit(1) | ||
| } | ||
|
|
||
| // Linux: convert knice => unice see https://linux.die.net/man/2/getpriority | ||
| if runtime.GOOS == "linux" { | ||
| fmt.Printf("%d\n", (niceValue-20)*-1) | ||
| } else { | ||
| fmt.Printf("%d\n", niceValue) | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.