From 09f46bae4b0dfe10d941655fc6279fa60d08a418 Mon Sep 17 00:00:00 2001 From: Maas Lalani Date: Fri, 25 Jun 2021 22:09:17 -0400 Subject: [PATCH] Short tests don't rely on PATH --- .github/workflows/test.yml | 2 +- CONTRIBUTING.md | 4 +++- Makefile | 3 +++ docs/development/README.md | 5 +++++ internal/code/execute_test.go | 3 +++ internal/code/languages.go | 2 +- 6 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b0b25bb..0ae4f5a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,4 +20,4 @@ jobs: uses: golangci/golangci-lint-action@v2 - name: Test - run: go test -race -v ./... + run: go test -race -v -short ./... diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7e4bfb8..44401e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1 +1,3 @@ -Pull requests welcome! +Take a look at the [Development Docs](./docs/development/README.md). + +Pull requests are welcome! diff --git a/Makefile b/Makefile index 2039bbe..907be69 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ make: go run main.go examples/slides.md +test: + go test ./... -short + build: go build -o slides diff --git a/docs/development/README.md b/docs/development/README.md index 181f6a1..57ebeac 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -11,6 +11,11 @@ everything still works. If you're adding a feature that requires a specific piece of markdown, you can add a file with your test case into `examples/.md` and iterate on that file. +Ensure tests are still passing +``` +make test +``` + ### Breaking Changes Most changes should be entirely backwards compatible. Ensure that `slides examples/slides.md` still works. diff --git a/internal/code/execute_test.go b/internal/code/execute_test.go index f3dddd8..99f2fb4 100644 --- a/internal/code/execute_test.go +++ b/internal/code/execute_test.go @@ -102,6 +102,9 @@ func main() { } for _, tc := range tt { + if testing.Short() { + t.SkipNow() + } r := code.Execute(tc.block) if r.Out != tc.expected.Out { t.Fatalf("invalid output, got %s, want %s", r.Out, tc.expected.Out) diff --git a/internal/code/languages.go b/internal/code/languages.go index 4bdb8c0..93fd6dd 100644 --- a/internal/code/languages.go +++ b/internal/code/languages.go @@ -33,6 +33,6 @@ var Languages = map[string]Language{ }, Elixir: { Extension: "exs", - Command: []string{"elixir"}, + Command: []string{"elixir"}, }, }