aRustyDev / aRustyDev/pre-commit-hooks

test: Add comprehensive test coverage for all hooks

Aberta
#27 0 comentários 0 reações 0 responsáveis Ver no GitHub
enhancement good first issue
Linguagem predominante
Python
Estrelas
5
Forks
3
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

## Overview
Extend the bats testing framework to provide comprehensive test coverage for all 26 hook scripts.

## Current State
- Testing framework established with bats
- Sample tests created for:
- `hooks/commits/gitlint.sh`
- `hooks/nix/nix-fmt.sh`
- Test helper utilities available
- CI integration configured

## Requirements

### Test Coverage Goals
- [ ] 100% of hooks have at least basic tests
- [ ] 80%+ code coverage across all hooks
- [ ] Edge cases and error conditions tested
- [ ] Multi-platform compatibility verified

### Hooks Needing Tests

#### Commits
- [ ] commitizen.sh
- [ ] commitlint.sh
- [x] gitlint.sh ✅

#### Nix
- [ ] attestation.nix
- [ ] nix-build-check.sh
- [ ] nix-build.sh
- [ ] nix-darwin-check.sh
- [ ] nix-flake-check.sh
- [x] nix-fmt.sh ✅
- [ ] nix-home-manager-check.sh
- [ ] nix-lint.sh
- [ ] publish-to-nixpkgs.sh

#### CI
- [ ] github.sh
- [ ] gitlint.sh

#### Configs
- [ ] yamlfmt.sh

#### Terraform
- [ ] pluralith.sh
- [ ] tfupdate.sh

#### Web
- [ ] css/csslint.sh
- [ ] js/eslint.sh
- [ ] js/fixmyjs.sh
- [ ] js/jshint.sh
- [ ] scss/scss-lint.sh

#### Other
- [ ] backup-nixos.sh
- [ ] update-vm.sh
- [ ] witness.sh
- [ ] pluralith.sh (root)

## Test Structure
Each test file should include:
1. Existence and executability check
2. Missing dependency handling
3. Success case validation
4. Failure case validation
5. Edge case handling (empty input, malformed data, etc.)

## Deliverables
- [ ] Complete test suite for all hooks
- [ ] Test documentation updates
- [ ] CI passing with all tests
- [ ] Coverage report generation
- [ ] Performance benchmarks

## Success Criteria
- All hooks have corresponding test files
- Tests run successfully on Ubuntu and macOS
- Code coverage >80%
- All tests pass in CI
- Clear documentation for adding new tests

## Related
- #26 - CI/CD pipeline implementation
- #22 - Nix hooks test suite

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece lendo os testes existentes para hooks/commits/gitlint.sh e hooks/nix/nix-fmt.sh, depois inspecione os utilitários auxiliares de teste disponíveis e execute a suíte atual. Adicione testes correspondentes para os hooks restantes listados, cobrindo existência, dependências, sucesso, falha e casos extremos. Considera-se concluído quando todos os hooks estiverem testados, a CI do Ubuntu e do macOS passar, a cobertura exceder 80% e a documentação de testes e os relatórios de cobertura forem atualizados.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
shell
Domínio
testing
Tipo de issue
Funcionalidade
Dificuldade
5/5
Tempo estimado
Mais de uma semana
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.