|
| 1 | +# Project Guidelines |
| 2 | + |
| 3 | +## Architecture |
| 4 | +- This repo has two main testing domains: |
| 5 | + - Ruby tooling code in `lib/` with tests in `test/` (Minitest). |
| 6 | + - Dev Container Features in `features/src/*` with integration tests in `features/test/*` (devcontainer CLI + shell scripts/scenarios). |
| 7 | +- Entry-point scripts in `bin/` usually orchestrate updates that must be validated by Ruby tests and feature tests. |
| 8 | + |
| 9 | +## Build and Test |
| 10 | +- Prefer running the smallest relevant test set first, then broader suites. |
| 11 | + |
| 12 | +### Ruby tests (root) |
| 13 | +- Install deps: `bundle install` |
| 14 | +- Run all Ruby tests: `bundle exec rake test` |
| 15 | +- Equivalent: `rake test` |
| 16 | + |
| 17 | +### Feature tests (from repo root) |
| 18 | +- Install Node deps (if needed): `npm install` |
| 19 | +- Run all feature tests via package script: `npm test` |
| 20 | +- Preferred shortcut via Rake: `rake features:test` |
| 21 | + |
| 22 | +### Feature tests (targeted, from repo root) |
| 23 | +- Prerequisite: install project deps from repo root (`npm install`) to get the devcontainer CLI from `package.json`. |
| 24 | +- Autogenerated tests for one feature: |
| 25 | + - `rake features:autogenerated FEATURE=ruby IMAGE=ubuntu:latest` |
| 26 | +- Scenario tests for one feature: |
| 27 | + - `rake features:scenarios FEATURE=ruby` |
| 28 | +- Direct CLI equivalents (run from `features/`): |
| 29 | + - `npx devcontainer features test --skip-scenarios -f ruby -i ubuntu:latest .` |
| 30 | + - `npx devcontainer features test -f ruby --skip-autogenerated --skip-duplicated .` |
| 31 | + |
| 32 | +### Shell script linting (from `features/`) |
| 33 | +- `find . -name "*.sh" -type f -exec shellcheck {} +` |
| 34 | + |
| 35 | +## Conventions |
| 36 | +- Keep tests close to the affected area: |
| 37 | + - `lib/**` changes should include/adjust `test/**/*_test.rb`. |
| 38 | + - `features/src/<name>/**` changes should include/adjust `features/test/<name>/**`. |
| 39 | +- Preserve current patterns in existing tests: |
| 40 | + - Ruby tests use Minitest style and temp-directory isolation. |
| 41 | + - Feature tests use `dev-container-features-test-lib` assertions (`check`, `reportResults`) and scenario matrices in `scenarios.json`. |
0 commit comments