-
Notifications
You must be signed in to change notification settings - Fork 60
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
Fix content tests; run tests via GitHub Actions #260
Fix content tests; run tests via GitHub Actions #260
Conversation
We would need to review this together before I can accept it. I don't run any tests since the code was taken from the Go team and I don't update it. I just check the site and publish. I'm not adverse but we will need to jump on a call. |
@ardan-bkennedy I updated the PR's description with extended explanation. Hope this clarifies changes a bit. |
It's too big and I want to review this with you if I'm going to accept it. I'll ping you during the week |
Fix package name: content -> website. Walk over _content/tour instead of .
Give me a PR to the bill/testing branch please. |
Changed base branch to the |
Hello @ardan-bkennedy, |
I could not get the tests to work. When I run go test ./... everything hangs. I have not had the time to review why. |
The tests are not hanging; they are just slow. I changed the test to target only the
|
The PR fixes the test that checks code examples in the
_content/tour
directory and adds GitHub Actions workflow to run tests on each PR or push to themain
branch.Now, running
go test -v ./...
works flawlessly.I have divided the PR into separate logical commits to facilitate review. Each commit corresponds to one logical change.
Changes:
TestContent
to work with//go:build
build constraint. It's worth mentioning that the tour from Go team's uses// +build
comments, but this gotour uses//go:build
(introduced here drop legacy build tag #45). Thus,TestContent
has been adapted to work with//go:build
.content_test.go
to the root becausego test
skips the_content
folder when detecting tests.TestContent
toTestContentTour
.content_test.go
that checks examples for all languages.OMIT
to all code snippets.nobuild
to code snippets that cannot be compiled viago build
.norun
to code snippets that cannot be executed. Note that we cannot useno-run
(with a hyphen) as a build constraint name.