You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "aglinxinyuan (via GitHub)" <gi...@apache.org> on 2026/06/16 22:24:14 UTC
[I] add unit test coverage for VirtualCollection + ReadonlyVirtualDocument + ReadonlyLocalFileDocument [texera]
aglinxinyuan opened a new issue, #5736:
URL: https://github.com/apache/texera/issues/5736
### Task Summary
Add dedicated unit-specs for three storage-model classes / traits in `common/workflow-core/core/storage/model/`. Pin the trait contracts via test-only subclasses and the local-file concrete impl through a temp-file harness.
## Background
| Source class | Purpose |
| --- | --- |
| `VirtualCollection` | Abstract base for a one-level collection of `VirtualDocument`s (`getURI` / `getDocuments` / `getDocument(name)` / `remove()`) |
| `ReadonlyVirtualDocument[T]` | Trait declaring the read-only document surface (`getURI` / `getItem` / `get()` / `getRange` / `getAfter` / `getCount` / `asInputStream` / `asFile`) |
| `ReadonlyLocalFileDocument` | `private[storage]` concrete impl of `ReadonlyVirtualDocument[Nothing]` backed by a local file URI; iterator-style methods are deliberately unsupported (`throw new NotImplementedError`) |
## Behavior to pin
### `VirtualCollection`
| Surface | Contract |
| --- | --- |
| Trait declares four abstract methods | `getURI`, `getDocuments`, `getDocument`, `remove` (pinned via a test-only concrete subclass) |
| A concrete subclass implementing all four | composes (no missing abstract member errors) |
| Pattern matching | `_: VirtualCollection` matches a concrete instance |
### `ReadonlyVirtualDocument`
| Surface | Contract |
| --- | --- |
| Trait declares eight abstract methods | enumerated in the Background table; pinned via a minimal test-only concrete subclass that returns sentinel values |
| Default `getRange` signature accepts `columns: Option[Seq[String]] = None` | call site can omit the third argument |
| Type parameter `T` | preserved through `getItem` / `get` / `getRange` / `getAfter` |
### `ReadonlyLocalFileDocument`
| Surface | Contract |
| --- | --- |
| Constructor takes a `URI` | exposes it via `getURI` |
| `asFile()` | returns a `File` pointing at the same URI |
| `asInputStream()` | reads bytes from the file (round-trip the file content) |
| Successive `asInputStream()` calls | return independent streams |
| `getItem` / `get` / `getRange` / `getAfter` / `getCount` | each throws `NotImplementedError` with a descriptive message |
| Visibility | `private[storage]` — accessible from a spec in the same package |
## Scope
- New spec files (one per source class per the spec-filename convention):
- `VirtualCollectionSpec.scala`
- `ReadonlyVirtualDocumentSpec.scala`
- `ReadonlyLocalFileDocumentSpec.scala`
- No production-code changes.
- `ReadonlyLocalFileDocumentSpec` lives in `org.apache.texera.amber.core.storage.model` so the `private[storage]` class is accessible. It uses a `Files.createTempFile` harness to write known bytes and round-trip them via `asInputStream` / `asFile`.
### Task Type
- [ ] Refactor / Cleanup
- [ ] DevOps / Deployment / CI
- [x] Testing / QA
- [ ] Documentation
- [ ] Performance
- [ ] Other
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] add unit test coverage for VirtualCollection + ReadonlyVirtualDocument + ReadonlyLocalFileDocument [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #5736:
URL: https://github.com/apache/texera/issues/5736#issuecomment-4724137800
<!-- texera:template-compliance -->
👋 Thanks for opening this issue, @aglinxinyuan!
It looks like the issue description doesn't quite follow our template yet:
- This issue doesn't appear to use one of our templates (Bug, Feature, or Task). Please open it using a template so the required details are captured.
Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.
You can find the template prompts by editing the description, or see [CONTRIBUTING.md](https://github.com/apache/texera/blob/main/CONTRIBUTING.md) for the full contribution flow.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] add unit test coverage for VirtualCollection + ReadonlyVirtualDocument [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan closed issue #5736: add unit test coverage for VirtualCollection + ReadonlyVirtualDocument
URL: https://github.com/apache/texera/issues/5736
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org