Skip to content

Commit 1498cdf

Browse files
authored
feat: Allow validating testoperator in benchmark workflow (spiceai#5342)
* feat: Allow validation during testoperator benchmark * fix: Update schema equivalence in validator
1 parent 0ea0178 commit 1498cdf

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

.github/workflows/testoperator_run_bench.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ on:
6161
options:
6262
- 'always'
6363
- 'no'
64+
validate_results:
65+
description: 'Validate the results?'
66+
required: false
67+
type: boolean
68+
default: false
6469

6570
jobs:
6671
run-bench:
@@ -128,7 +133,8 @@ jobs:
128133
-d /opt/spiced/data \
129134
--query-set ${{ github.event.inputs.query_set }} \
130135
--ready-wait ${{ github.event.inputs.ready_wait }} \
131-
--disable-progress-bars
136+
--disable-progress-bars \
137+
--validate=${{ github.event.inputs.validate_results }}
132138
env:
133139
S3_ENDPOINT: ${{ secrets.MINIO_ENDPOINT}}
134140
S3_KEY: ${{ secrets.MINIO_ACCESS_KEY}}
@@ -168,7 +174,15 @@ jobs:
168174
if: ${{ github.event.inputs.query_overrides != '' }}
169175
run: |
170176
rm -rf .spice/data
171-
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" testoperator run bench -s /usr/local/bin/spiced -p ${{ github.event.inputs.spicepod_path }} -d /opt/spiced/data --query-set ${{ github.event.inputs.query_set }} --query-overrides ${{ github.event.inputs.query_overrides }} --ready-wait ${{ github.event.inputs.ready_wait }} --disable-progress-bars
177+
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" testoperator run bench \
178+
-s /usr/local/bin/spiced \
179+
-p ${{ github.event.inputs.spicepod_path }} \
180+
-d /opt/spiced/data \
181+
--query-set ${{ github.event.inputs.query_set }} \
182+
--query-overrides ${{ github.event.inputs.query_overrides }} \
183+
--ready-wait ${{ github.event.inputs.ready_wait }} \
184+
--disable-progress-bars \
185+
--validate=${{ github.event.inputs.validate_results }}
172186
env:
173187
S3_ENDPOINT: ${{ secrets.MINIO_ENDPOINT}}
174188
S3_KEY: ${{ secrets.MINIO_ACCESS_KEY}}

crates/test-framework/src/queries/validation/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ fn datatype_equivalent(expected_type: DataType, actual_type: DataType) -> bool {
137137
| (DataType::Int32, DataType::Int64)
138138
| (
139139
DataType::Int64,
140-
DataType::Int32 | DataType::Float64 | DataType::Utf8
140+
DataType::Int32 | DataType::Float64 | DataType::Utf8 | DataType::LargeUtf8
141141
)
142142
| (DataType::Utf8, DataType::LargeUtf8)
143143
)

tools/testoperator/src/args/dataset.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
use clap::{Parser, ValueEnum};
17+
use clap::{ArgAction, Parser, ValueEnum};
1818
use serde::{Deserialize, Serialize};
1919
use std::path::PathBuf;
2020
use test_framework::queries::{QueryOverrides, QuerySet};
@@ -37,7 +37,7 @@ pub struct DatasetTestArgs {
3737
#[arg(long)]
3838
pub(crate) query_overrides: Option<QueryOverridesArg>,
3939

40-
#[arg(long)]
40+
#[arg(long, action = ArgAction::Set, default_value_t = false, default_missing_value = "true", num_args = 0..=1, require_equals = false)]
4141
pub(crate) validate: bool,
4242
}
4343

0 commit comments

Comments
 (0)