Closed alexandear closed 4 months ago
Follows #260
It's possible to check this PR locally via the GitHub CLI
by executing the following command:
gh pr checkout 262
This needs to merge to bill/testing
It's possible to review this PR without merging it into bill/testing
. For instructions, please visit Checking Out Pull Requests Locally.
Not sure why? I will need to merge it into main anyway. I can easily do that in this testing branch.
I can delete this branch and give you a new one to merge to?
Not sure why? I will need to merge it into main anyway. I can easily do that in this testing branch.
I'm assuming we are using the GitHub flow. This flow includes the following steps:
ardanlabs/gotour
into alexandear/gotour
.alexandear:fix-content-test
and created this PR.main
by pressing the button "Merge". GitHub will automatically mark the PR as "Merged".The PR is TOO BIG and it scares me. I have to review it and make sure nothing breaks. I need it in my testing branch I provided if you want to see this merged.
I created a new bill/testing2 branch for this PR.
I reverted all changes related to local translations (they will be fixed later) and retained only the fixes for examples in the eng
directory to simplify the review process.
Only two files require thorough review:
All other modifications add nobuild
and norun
build constraints to examples.
Also, the tests are passed on CI: https://github.com/ardanlabs/gotour/actions/runs/9681636341/job/26712671977?pr=262
I will NOT being merging this into main directly. You will need to merge this into bill/testing2 so I can gain access to the code directly and run my own test and review. If you are not willing to do this, I can't accept it. I apprecaite the time and effort you are putting into this. That is why I am asking you for this again.
@ardan-bkennedy changed branch from main
to bill/testing2
.
I made a some minor refactoring changes. This code is nice and I was able to see what you did. Pull down these changes and you can give me a PR to main and I will accept it. Make sure you have your name in the CONTRIBUTORS file please.
Thank you. Created #263.
My name already in the CONTRIBUTORS file.
The PR fixes the test that checks code examples in the
_content/tour/eng
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
toTestContentEngTour
. Run tests only foreng
directory.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.