Add a `golden-test check` command to run in PRs
- Linguagem predominante
- Go
- Estrelas
- 16
- Forks
- 4
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
User journey: as a template author who maintains templates outside of the abc repo, I want an easy way to test my templates as part of the pull request process.
We could create a single command that would be invoked in an`on: pull_request` GitHub Action. This command would:
- Make sure all templates have at least one golden test. If not, print a helpful message about using the `new-test` command which will be released soon.
- Make sure all golden tests are passing (`verify`). If they're failing due to a test data mismatch, suggest running the `record` command. If they're failing due to a broken spec.yaml, identify the failing spec.yaml and describe the problem with it.
All problems should be reported, not just the first problem that is found.
The command could be `abc templates golden-test check`. It could have an optional parameter giving the starting directory.
We could also provide a github action that would download the latest build of `abc` and run this new command.
A good first customer for this would be the github.com/abcxyz/guardian repo. @verbanicm @gjonathanhong
EDIT:
Here's another possibility: expand the scope of this from just golden-tests to everything having to do with abc templates. We could have a command `abc templates check-clean` that would perform all the above checks, and also look for upgrade operations with incomplete merges (there should be no files with an `.abcmerge_...` suffix).
Guia de contribuição
Direção de pesquisa
Look at the existing `abc templates` command structure and golden test commands (`verify`, `record`). The new command should be added to the CLI, likely in a file like `cmd/abc/templates_golden_test_check.go`. Start by understanding how golden tests are discovered and verified. The command should iterate over templates, check for test existence, run verifications, and aggregate errors. Test it using the guardian repository as suggested.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- shell
- Domínio
- ci-cd, cli, tooling
- Tipo de issue
- Funcionalidade
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 50/100