Closed alexandear closed 4 months ago
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
Give me a PR to the bill/testing branch please.
Give me a PR to the bill/testing branch please.
Changed base branch to the bill/testing
.
Hello @ardan-bkennedy,
I noticed that you merged into the bill/testing
branch. Is there a chance this PR will be merged into the main
branch?
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 eng
directory (see the PR #262), and it took 50 seconds to complete:
❯ go test ./...
? github.com/ardanlabs/gotour/cmd/markdown-to-site [no test files]
? github.com/ardanlabs/gotour/cmd/tour [no test files]
? github.com/ardanlabs/gotour/internal/tour [no test files]
? github.com/ardanlabs/gotour/internal/socket [no test files]
ok github.com/ardanlabs/gotour 49.456s
ok github.com/ardanlabs/gotour/internal/webtest (cached)
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 #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.