Skip to content
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

[v1] fix CI, add Go 1.17.x and 1.18.x #1379

Merged
merged 1 commit into from Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 3 additions & 9 deletions .github/workflows/cli.yml
Expand Up @@ -15,13 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go:
- 1.16.x
# NOTE: tests fail with panic at
# TestApp_RunAsSubCommandIncorrectUsage on these
# versions:
# - 1.17.x
# - 1.18.x
go: [1.16.x, 1.17.x, 1.18.x]
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -38,6 +32,6 @@ jobs:

- name: Run Tests
run:
go run build.go vet &&
go run build.go test &&
go run build.go vet
go run build.go test
Comment on lines -41 to +36
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL that the default is to run with set -e 😯 !

go run build.go toc docs/v1/manual.md
8 changes: 8 additions & 0 deletions app_test.go
Expand Up @@ -508,6 +508,14 @@ func TestApp_RunAsSubcommandParseFlags(t *testing.T) {
}

func TestApp_RunAsSubCommandIncorrectUsage(t *testing.T) {
// Go 1.17+ panics when invalid flag is given.
// Catch it here and consider the test passed.
defer func() {
if err := recover(); err == nil {
t.Fatal("expected error, got nothing")
}
}()

a := App{
Flags: []Flag{
StringFlag{Name: "--foo"},
Expand Down