Skip to content

Conversation

@dinhlongviolin1
Copy link
Contributor

@dinhlongviolin1 dinhlongviolin1 commented Sep 9, 2025

Describe Your Changes

  • Add tests for rust backend
  • Fix mise to also run backend test properly
  • Fix failing test for frontend (windows).

Fixes Issues

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

Important

Enhance testing framework by adding Rust backend tests, fixing Windows frontend tests, and updating configurations.

  • Testing Enhancements:
    • Add tests for Rust backend in src-tauri/plugins/tauri-plugin-llamacpp/src/device.rs, src-tauri/plugins/tauri-plugin-llamacpp/src/path.rs, and src-tauri/utils/src/crypto.rs.
    • Add frontend tests in web-app/src/services/__tests__/serviceHub.integration.test.ts and web-app/src/services/__tests__/web-specific.test.ts.
    • Fix failing frontend test for Windows in web-specific.test.ts.
  • Configuration Updates:
    • Update Makefile to include new Rust test paths.
    • Update mise.toml to separate Rust and JS test tasks and dependencies.
  • Miscellaneous:
    • Add tempfile as a dev-dependency in Cargo.toml for testing purposes.
    • Set type to module in package.json to support ES module syntax.

This description was created by Ellipsis for 7106724. You can customize this summary. It will automatically update as commits are pushed.

@dinhlongviolin1 dinhlongviolin1 self-assigned this Sep 9, 2025
@dinhlongviolin1 dinhlongviolin1 changed the title Feat/improve testing feat: improve testing Sep 9, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 8085ae4 in 2 minutes and 20 seconds. Click for details.
  • Reviewed 1170 lines of code in 12 files
  • Skipped 0 files when reviewing.
  • Skipped posting 9 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. Makefile:68
  • Draft comment:
    Added the test for the 'src-tauri/utils' package. Ensure the ordering and grouping of Rust tests is intentional and consistent with other targets.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to ensure the ordering and grouping of Rust tests is intentional and consistent. This falls under asking the author to ensure behavior is intended, which is against the rules.
2. mise.toml:201
  • Draft comment:
    The 'test-only' task now depends on both JS and Rust tests. Confirm that this merged dependency meets your intended parallel testing workflow.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to confirm their intention regarding the merged dependency for the 'test-only' task. This violates the rule against asking the author to confirm their intention or ensure behavior is intended. The comment does not provide a specific suggestion or point out a clear issue.
3. package.json:4
  • Draft comment:
    The addition of "type": "module" enforces ESM. Ensure that all dependencies and internal modules are compatible with ESM.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to ensure compatibility with ESM, which is a form of asking them to double-check something. This violates the rule against asking the author to ensure behavior is intended or tested.
4. src-tauri/plugins/tauri-plugin-llamacpp/src/device.rs:236
  • Draft comment:
    Comprehensive tests for memory and device parsing have been added. Consider including additional edge cases (e.g., extra spaces or irregular formatting) for even greater robustness.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The existing test suite is already quite comprehensive. It tests normal cases, boundary cases (0 MiB), invalid formats, missing data, and malformed input. While more edge cases are always possible, the core functionality and error cases are well covered. The suggestion feels like a "nice to have" rather than identifying a real gap in testing. The comment could be right that additional edge cases like extra whitespace could find bugs. However, the parsing code uses trim() extensively and the existing tests already cover the key failure modes. Given the robust error handling and whitespace handling already in the code, plus the comprehensive test suite covering both success and failure cases, additional edge case tests would likely just be redundant. The comment should be deleted as it suggests additional work without identifying any specific gaps or issues in the existing thorough test coverage.
5. src-tauri/plugins/tauri-plugin-llamacpp/src/path.rs:250
  • Draft comment:
    The tests for validate_model_path and validate_mmproj_path functions are comprehensive, covering missing flags, missing values, and multiple occurrences. Great job!
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
6. src-tauri/utils/src/math.rs:29
  • Draft comment:
    The deterministic jitter uses DefaultHasher which may change between Rust versions. Consider using a fixed hasher to lock in the jitter behavior for stability in tests.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. src-tauri/utils/src/crypto.rs:138
  • Draft comment:
    The tests for file hashing with cancellation are thorough and verify expected outcomes. This robust testing ensures reliability for file I/O and asynchronous cancellation.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
8. web-app/src/services/__tests__/serviceHub.integration.test.ts:15
  • Draft comment:
    The integration test utilizes extensive mocks for service instantiation. Consider centralizing common mocks to reduce duplication and improve maintainability.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The suggestion to centralize mocks is a reasonable code quality improvement. The file has many similar mock implementations that could potentially be simplified. However, the mocks are already somewhat organized by platform type, and centralizing them could make the test file less clear by separating the mocks from where they're used. The comment doesn't provide specific guidance on how to centralize the mocks. The current organization by platform type might actually be more maintainable than a centralized approach. While mock centralization could reduce duplication, the current organization is clear and maintainable. The comment doesn't provide enough specific value to justify a code change. The comment should be removed as it suggests a refactor without clear benefits or specific guidance.
9. web-app/src/services/__tests__/web-specific.test.ts:41
  • Draft comment:
    Tests for WebThemeService and WebProvidersService effectively validate DOM manipulation and fetch usage. To further enhance coverage, consider adding error-case scenarios for network failures in fetch calls.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_TWeIWjns0jf92rTn

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

Barecheck - Code coverage report

Total: 30.11%

Your code coverage diff: -0.40% ▾

✅ All code changes are covered

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 7106724 in 1 minute and 2 seconds. Click for details.
  • Reviewed 615 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src-tauri/plugins/tauri-plugin-llamacpp/src/path.rs:182
  • Draft comment:
    Good update: using conditional assertions for Windows vs non-Windows in test_validate_model_path_valid improves robustness. The use of file existence check on Windows is a nice workaround for unpredictable short path formats.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. src-tauri/plugins/tauri-plugin-llamacpp/src/path.rs:227
  • Draft comment:
    Similarly, the test for validate_mmproj_path now correctly distinguishes between Windows and non-Windows. This conditional handling is clear and appropriate.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. src-tauri/plugins/tauri-plugin-llamacpp/src/path.rs:84
  • Draft comment:
    Consider refactoring the duplicated platform-specific args update logic in both validate_model_path and validate_mmproj_path into a helper function for better maintainability.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
4. src-tauri/plugins/tauri-plugin-llamacpp/src/path.rs:150
  • Draft comment:
    The test suite is comprehensive and covers various edge cases, including multiple flags and missing flag/value scenarios. Nice work improving the testing.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_iLN9kPjF0IRCbYYF

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@dinhlongviolin1 dinhlongviolin1 merged commit 5cd81bc into dev Sep 9, 2025
17 checks passed
@github-project-automation github-project-automation bot moved this to QA in Jan Sep 9, 2025
@dinhlongviolin1 dinhlongviolin1 deleted the feat/improve-testing branch September 9, 2025 05:16
@github-actions github-actions bot added this to the v0.7.0 milestone Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants