Skip to content

Add REPL feature tests and count command#17

Merged
aisrael merged 11 commits intomainfrom
repl-tests
Mar 2, 2026
Merged

Add REPL feature tests and count command#17
aisrael merged 11 commits intomainfrom
repl-tests

Conversation

@aisrael
Copy link
Owner

@aisrael aisrael commented Mar 2, 2026

Summary

  • Reorganize feature tests into features/cli/ and features/repl/ directories, with separate test harnesses (tests/features.rs for CLI, tests/repl.rs for REPL)
  • Add comprehensive REPL feature tests covering conversion (Parquet/Avro/ORC/XLSX ↔ CSV/JSON/YAML), head, tail, and select operations with pipeline composition (|>)
  • Implement count() command in the REPL pipeline, including unit tests and pipeline integration tests
  • Bump version to 0.3.0-alpha
  • Add expectrl dev dependency for spawning and interacting with the REPL process in tests
  • Normalize step definitions (e.g., the first line should bethe first line of the output should be) for consistency across CLI and REPL tests

Key changes

Area Files
REPL features features/repl/{repl,conversion,head,select,tail}.feature
REPL test harness tests/repl.rs (new, 340 lines)
REPL count() src/cli/repl.rs
CLI features (moved) features/cli/{cli,convert,count,head,schema,tail}.feature
CLI test harness tests/features.rs (updated path + new step defs)
Dependencies Cargo.toml (expectrl), Cargo.lock

Commits (11)

  • Update README and feature tests for output clarity and record validation
  • Add interactive REPL section to README
  • Add REPL feature tests for head, select, and tail operations
  • Add validation steps for output files in REPL conversion scenarios
  • Add comprehensive conversion scenarios and validation in REPL tests
  • Add conversion feature and implement count command in REPL
  • Update datu version to 0.3.0-alpha
  • Update CLI feature tests for version output and first line validation
  • Enhance REPL functionality and add feature tests
  • Move cli features to features/cli
  • Update tail feature tests for output clarity and first line validation in Rust tests

- Introduced a new REPL feature with a corresponding test suite to validate its output.
- Added `expectrl` as a dependency for handling REPL interactions.
- Created a new `repl.feature` file to define the REPL behavior and expectations.
- Implemented `repl.rs` to manage REPL sessions and validate output against expected results.
- Updated `Cargo.toml` to include the new `expectrl` dependency and added a test configuration for the REPL.
- Changed expected output for the version command from "datu 0.2.4" to "datu 0.3.0-alpha".
- Updated the first line validation in the head feature tests to specify "the first line of the output should be" for clarity.
- Adjusted regex patterns in Rust tests to match the new output expectations for first line assertions.
- Introduced a new feature for converting data from Parquet to CSV format, with a scenario to validate the output file's existence and content.
- Added a `Count` variant to the `PipelineStage` enum, enabling row counting across batches in the REPL.
- Implemented the `exec_count` method to calculate and print the total number of rows.
- Enhanced REPL tests to include scenarios for the new count functionality and conversion feature, ensuring robust validation of expected behaviors.
- Expanded the conversion feature in the REPL by adding multiple scenarios for converting data between various formats including Parquet, Avro, and ORC to CSV, JSON, YAML, and XLSX.
- Implemented new validation steps in the tests to ensure output files exist, are valid in their respective formats, and contain expected content.
- Enhanced the REPL test suite with additional assertions for line counts and content validation, improving overall test coverage and reliability.
- Enhanced the conversion feature tests by adding validation steps to ensure that output files generated from various conversions (Avro, Parquet, ORC, XLSX) are not only created but also valid according to their respective formats.
- Implemented new test functions to check the validity of Avro, Parquet, ORC, and XLSX files, improving the robustness of the REPL test suite and ensuring accurate data handling across formats.
- Introduced new feature files for head, select, and tail operations in the REPL, covering various scenarios for reading data from Parquet, Avro, and ORC formats.
- Each feature includes validation steps to ensure output files are created, exist in the correct format (CSV, JSON, YAML, Parquet, Avro), and contain expected content.
- Enhanced test coverage for data manipulation operations, improving the robustness of the REPL test suite.
- Introduced a new section in the README detailing the interactive REPL (Read-Eval-Print Loop) feature of `datu`.
- Documented the usage of key functions such as `read`, `write`, `select`, `head`, and `tail`, along with examples for composing data pipelines.
- Enhanced user guidance on chaining functions to build complex data processing workflows.
- Changed code block formatting in the README from plain to text for better readability.
- Enhanced feature tests for the `head` command in CLI and REPL by specifying that output files should have a defined number of records.
- Added a new step in the REPL tests to validate the number of records in output files, improving test coverage and ensuring accurate data handling.
@aisrael aisrael merged commit 32c2cc5 into main Mar 2, 2026
4 checks passed
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