-
Notifications
You must be signed in to change notification settings - Fork 59
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 eng content tests; run tests via GitHub Actions #262
Fix eng content tests; run tests via GitHub Actions #262
Conversation
Fix package name: content -> website. Walk over _content/tour instead of .
Follows #260 It's possible to check this PR locally via the gh pr checkout 262 |
This needs to merge to bill/testing |
It's possible to review this PR without merging it into |
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? |
I'm assuming we are using the GitHub flow. This flow includes the following steps:
|
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 Only two files require thorough review:
All other modifications add 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 |
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 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
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.