ardanlabs / gotour

Apache License 2.0
100 stars 60 forks source link

Fix content tests; run tests via GitHub Actions #260

Closed alexandear closed 4 months ago

alexandear commented 4 months ago

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 the main 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:

ardan-bkennedy commented 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.

alexandear commented 4 months ago

@ardan-bkennedy I updated the PR's description with extended explanation. Hope this clarifies changes a bit.

ardan-bkennedy commented 4 months ago

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

ardan-bkennedy commented 4 months ago

Give me a PR to the bill/testing branch please.

alexandear commented 4 months ago

Give me a PR to the bill/testing branch please.

Changed base branch to the bill/testing.

alexandear commented 4 months ago

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?

ardan-bkennedy commented 4 months ago

I could not get the tests to work. When I run go test ./... everything hangs. I have not had the time to review why.

alexandear commented 4 months ago

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)