Skip to content

Commit 32c2cc5

Browse files
authored
Add REPL feature tests and count command (#17)
* Update tail feature tests for output clarity and add first line validation in Rust tests * Move cli features to `features/cli` * Enhance REPL functionality and add feature 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. * Update CLI feature tests for version output and first line validation - 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. * Update datu version to 0.3.0-alpha in Cargo.toml and Cargo.lock * Add conversion feature and implement count command in REPL - 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. * Add comprehensive conversion scenarios and validation in REPL tests - 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. * Add validation steps for output files in REPL conversion scenarios - 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. * Add REPL feature tests for head, select, and tail operations - 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. * Add interactive REPL section to README - 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. * Update README and feature tests for output clarity and record validation - 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.
1 parent e5111c6 commit 32c2cc5

File tree

17 files changed

+1288
-44
lines changed

17 files changed

+1288
-44
lines changed

Cargo.lock

Lines changed: 141 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "datu"
3-
version = "0.2.4"
3+
version = "0.3.0-alpha"
44
edition = "2024"
55
description = "datu - a data file utility"
66
license = "MIT"
@@ -37,6 +37,7 @@ flt = { version = "0.0.2" }
3737
[dev-dependencies]
3838
criterion = "0.5"
3939
cucumber = "0.22.1"
40+
expectrl = "0.8"
4041
serde_yaml = "0.9"
4142
gherkin = "0.15"
4243
tempfile = "3"
@@ -48,3 +49,7 @@ harness = false
4849
[[test]]
4950
name = "features"
5051
harness = false
52+
53+
[[test]]
54+
name = "repl"
55+
harness = false

0 commit comments

Comments
 (0)