Skip to content

feat: Add test suite, depersonalize examples, and fix optional fields#1

Merged
kadykov merged 63 commits into
mainfrom
refactor/interface
May 1, 2025
Merged

feat: Add test suite, depersonalize examples, and fix optional fields#1
kadykov merged 63 commits into
mainfrom
refactor/interface

Conversation

@kadykov
Copy link
Copy Markdown
Owner

@kadykov kadykov commented Apr 26, 2025

This PR implements the first phase of improvements, focusing on project robustness, maintainability, and general usability.

Key Changes:

  • Testing Framework:
    • Added a comprehensive test suite covering different levels:
      • Unit tests for build.sh using Bats (tests/unit/).
      • Filter tests for Lua filters (linkify.lua, typst-cv.lua) using Bats (tests/filter/).
      • End-to-end smoke tests (tests/test_e2e.sh) verifying PDF generation and basic content checks using pdftotext.
    • Installed Bats and helper libraries as Git submodules (tests/bats, tests/test_helper).
    • Debugged and resolved various issues encountered during test implementation (path resolution, command execution, file I/O, YAML/Typst errors).
  • Depersonalization:
    • Replaced previous personalized example files (kadykov-*.md, photo.jpg) with generic fixtures (example-cv.md, example-letter.md, example-cv-no-optional.md) using placeholder data.
    • Added a placeholder image (tests/fixtures/placeholder-photo.png).
  • Bug Fix:
    • Corrected default values in style.typ for optional fields (website, github, gitlab, linkedin) from "default" to none.
    • Added conditional logic in the style.typ footer to only display links/icons for these fields if they are actually provided (not none).
    • Added a specific E2E test case (example-cv-no-optional.md) to verify this fix using pdftotext.
  • CI/CD:
    • Updated the GitHub Actions workflow (.github/workflows/ci.yml) to execute the new test suites (unit, filter, e2e) within the built Docker container.
    • Added poppler-utils (for pdftotext) to the Dockerfile.
    • Removed the previous GitHub Pages deployment job related to personal CVs.
    • Ensured example PDFs are generated and uploaded as artifacts for GitHub Releases.
  • Development Experience:
    • Added a justfile with recipes for common tasks like running linters (just lint), individual test suites (just test-unit, etc.), all tests (just test), and building examples (just build-examples).
    • Added shellcheck to the pre-commit configuration (.pre-commit-config.yaml) and addressed reported warnings in shell scripts using directives where necessary.
  • Documentation & Templates:
    • Updated README.md to reflect the new examples and clarify usage guidelines (heading structure, linkification, overrides).
    • Updated Typst templates (typst-cv.typ, typst-letter.typ) to correctly handle structured YAML dates and use direct imports for style.typ.
    • Updated Memory Bank files (activeContext.md, progress.md, techContext.md).

Notes:

  • The proposed --output-format typst feature for build.sh was reverted due to persistent difficulties in reliably testing the generated .typ output via the script. Testing currently relies on filter tests and E2E PDF checks.
  • Suggestions for refactoring typst-cv.lua (fixing function names, adding generic side content, etc.) have been noted but postponed to a future phase.

This work establishes a solid foundation with automated checks, making future development safer and easier.

kadykov added 30 commits April 23, 2025 23:08
…e Docker integration, and enhance README with new usage instructions
…w for private data, update examples for better structure and clarity
…t completion of Phase 1, enhance testing details, and clarify development environment setup
…refix for consistency across typst and lua files
…s, refactor filter tests, and implement new CV fixture to validate absence of optional footer links.
…ation

- Create Dockerfile to install fonts using fontist
- Update devcontainer.json to reference the new Dockerfile and adjust context
- Add devcontainer.env to .gitignore
- Introduce fontist-manifest.yml for font management
- Modify style.typ to set font weight for strong text
- Added poppler-utils to Dockerfile for additional functionality.
- Set up local Typst package symlink for development in Dockerfile.
- Updated Typst templates to use local package functions and improved comments for clarity.
…eamline build stages, and enhance project file organization
…triction, and improve output path logic for better error handling and clarity
kadykov added 13 commits April 29, 2025 22:11
…ce internal test execution, and clarify comments
…ow as submodules are no longer used for testing dependencies
@kadykov kadykov self-assigned this Apr 30, 2025
kadykov added 14 commits April 30, 2025 16:06
…ration and update Justfile for new test structure
…itional production image push, and update Docker login steps
…g for cache management, ensuring consistent updates to the ':latest' tag during PR builds.
…ing with Trivy, and Dependabot configuration
@kadykov kadykov merged commit b455b32 into main May 1, 2025
4 checks passed
@kadykov kadykov deleted the refactor/interface branch May 1, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant