-
Notifications
You must be signed in to change notification settings - Fork 0
GH-12: Add a language-agnostic set of regression tests #74
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0fb5246
Add Agents.md file to the repo
alextac98 9a0a7a1
Initial setup of cross-language regression tests
alextac98 01f30d4
a bit of refactoring
alextac98 2e79c2d
Add tests to CI + bump versions
alextac98 bb469af
fix version numbers everywhere else
alextac98 c18f0ec
fix PR comments
alextac98 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| # AGENTS.md - Guidance for agentic coding tools working in this repo. | ||
|
|
||
| ## Project Summary | ||
|
|
||
| This project is a library in multiple languages for handling units and checking consistency in mathematical operations and conversions. The core functionality is implemented in Rust, with each language binding having their own folder. The entire project is managed by Bazel as a build system. | ||
|
|
||
| ### Common Targets (Bazel) | ||
|
|
||
| - Rust core library: `//core:dv_rs` | ||
| - Rust tests: `//core:unit_tests`, `//core:units_tests`, `//core:operator_tests` | ||
| - Python test: `//python:test_dv` | ||
| - C example: `//examples/c:c_example` | ||
| - C++ example: `//examples/cpp:cpp_example` | ||
|
|
||
| ### Folder Structure | ||
|
|
||
| - `core`: Contains the core library implemented in Rust. | ||
| - `docs`: Documentation for the project for both users and developers. | ||
| - `python`: Python bindings for the core library. | ||
| - `cpp`: C++ bindings for the core library. | ||
|
|
||
| ## Notes for Agents | ||
|
|
||
| - If you need CI parity, mirror workflow commands in `.github/workflows/*.yaml`. | ||
|
|
||
| ### Code Review Guidelines | ||
|
|
||
| - Focus on overall structure, design patterns, and correctness. | ||
| - Avoid nitpicking formatting or comments unless they are egregiously bad. | ||
| - Ensure adherence to coding standards and best practices. | ||
|
|
||
| ## Build, Test, and Lint Commands | ||
|
|
||
| ### Bazel (preferred for all languages) | ||
|
|
||
| - Build everything: `bazel build //... --keep_going` | ||
| - Test everything: `bazel test //... --test_output=errors --keep_going` | ||
|
|
||
| ### Rust (core) | ||
| - Build core: `bazel build //core:dv_rs` | ||
| - Run all core tests: `bazel test //core/... --test_output=errors --keep_going` | ||
| - Run a single Rust test target: `bazel test //core:units_tests` | ||
| - Run a single Rust test function: | ||
| `bazel test //core:units_tests --test_arg=angle_conversions` | ||
| (Use Rust test name; Bazel passes args to the test binary.) | ||
| - Generate docs: `bazel build //core:docs` | ||
| - Serve docs: `bazel run //core:serve_docs` | ||
|
|
||
| ### Python (bindings) | ||
| - Run Python tests: `bazel test //python/... --test_output=errors --keep_going` | ||
| - Run the Python example: `bazel run //examples/python:python_example` | ||
| - Single Python test target: `bazel test //python:test_dv` | ||
| - Single Python test function (pytest -k): | ||
| `bazel test //python:test_dv --test_arg=-k --test_arg=TestMathFunctions` | ||
|
|
||
| ### C/C++ (bindings/examples) | ||
| - Run C example (Bazel): `bazel run //examples/c:c_example` | ||
| - Run C++ example (Bazel): `bazel run //examples/cpp:cpp_example` | ||
| - CMake demos (optional): | ||
| `cmake -S . -B build && cmake --build build --target dv_example_c dv_example_cpp` | ||
|
|
||
| ### Docs (Docusaurus) | ||
| - Docs live under `docs/` and are managed via Bazel + pnpm. | ||
| - Update pnpm lockfile (from `docs/`): | ||
| `bazel run -- @pnpm --dir $PWD install --lockfile-only` | ||
|
|
||
| ### Linting / Formatting | ||
| - No explicit lint or formatter config is enforced in this repo (yet) | ||
| - For Rust, follow `rustfmt`-style formatting if you need to reformat. | ||
| - For Python, follow PEP 8 style and keep imports sorted. | ||
|
|
||
| ## Code Style Guidelines | ||
| ### Cross-cutting | ||
| - Prefer Bazel targets over ad-hoc build scripts. | ||
| - Keep changes minimal; avoid introducing new tools unless required. | ||
| - Favor clear, explicit error messages that help users of the bindings. | ||
|
|
||
| ### Rust (core) | ||
| - Edition: 2021 (see `core/BUILD.bazel`). | ||
| - Naming: `snake_case` for functions/modules, `CamelCase` for types. | ||
| - Error handling: return `Result<_, String>` with clear messages. | ||
| - Use `expect` with a shared `FAIL_MSG` in tests (see `core/tests`). | ||
| - Prefer explicit conversions and unit compatibility checks. | ||
| - Keep unit parsing rules documented in doc comments. | ||
| - Use `&DimensionalVariable` for operator implementations to avoid copies. | ||
| - Avoid unnecessary `return` but keep consistent with existing style. | ||
|
|
||
| ### Python (bindings/tests) | ||
| - Testing framework: `pytest`. | ||
| - Test classes named `TestSomething`, methods named `test_*`. | ||
| - Keep docstrings on test classes/methods for clarity. | ||
| - Import order: stdlib, third-party, local (`dv_py`), then specific symbols. | ||
| - Raise and assert `DVError` for invalid operations. | ||
|
|
||
| ### C/C++ (bindings) | ||
| - Headers live in `cpp/include`: | ||
| - `dv_c.h` for C API | ||
| - `dv.hpp` for C++ RAII wrapper | ||
| - CMake support is minimal; prefer Bazel for consistency. | ||
|
|
||
| ### Docs (Docusaurus) | ||
| - Source in `docs/src` and `docs/docs`. | ||
| - Follow existing structure and avoid large refactors for small changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,4 +6,4 @@ | |
|
|
||
| major = 0 | ||
| minor = 3 | ||
| patch = 2 | ||
| patch = 3 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.