Skip to content

Commit

Permalink
fixup more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nik9000 committed Dec 13, 2024
1 parent ea3a9f5 commit 687d3df
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions modules/aggregations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ tasks.named("yamlRestCompatTestTransform").configure({ task ->
task.skipTest("aggregations/date_agg_per_day_of_week/Date aggregartion per day of week", "week-date behaviour has changed")
task.skipTest("aggregations/time_series/Configure with no synthetic source", "temporary until backport")
task.skipTest("aggregations/percentiles_hdr_metric/Negative values test", "returned exception has changed")
task.skipTest("aggregations/moving_fn/linearWeightedAvg", "math was wrong in previous versions")
})
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,17 @@ linearWeightedAvg:
- skip:
features: close_to

- requires:
test_runner_features: [capabilities]

- requires:
capabilities:
- method: POST
path: /_search
parameters: [method, path, parameters, capabilities]
capabilities: [moving_fn_right_math]
reason: "math not fixed yet"

- do:
search:
index: no_gaps
Expand All @@ -275,11 +286,11 @@ linearWeightedAvg:
- match: { hits.total.value: 6 }
- length: { aggregations.@timestamp.buckets: 6 }
- is_false: aggregations.@timestamp.buckets.0.d.value
- close_to: { aggregations.@timestamp.buckets.1.d.value: { value: 0.500, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.2.d.value: { value: 1.250, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.3.d.value: { value: 1.000, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.4.d.value: { value: 2.250, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.5.d.value: { value: 3.500, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.1.d.value: { value: 1.000, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.2.d.value: { value: 1.667, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.3.d.value: { value: 1.333, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.4.d.value: { value: 3.000, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.5.d.value: { value: 4.667, error: 0.0005 } }

- do:
search:
Expand All @@ -301,11 +312,11 @@ linearWeightedAvg:
- match: { hits.total.value: 6 }
- length: { aggregations.@timestamp.buckets: 6 }
- is_false: aggregations.@timestamp.buckets.0.d.value
- close_to: { aggregations.@timestamp.buckets.1.d.value: { value: 0.500, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.2.d.value: { value: 1.250, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.3.d.value: { value: 1.143, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.4.d.value: { value: 2.286, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.5.d.value: { value: 3.429, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.1.d.value: { value: 1.000, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.2.d.value: { value: 1.667, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.3.d.value: { value: 1.333, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.4.d.value: { value: 2.667, error: 0.0005 } }
- close_to: { aggregations.@timestamp.buckets.5.d.value: { value: 4.000, error: 0.0005 } }

---
ewma:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ private SearchCapabilities() {}
private static final String RANK_VECTORS_SCRIPT_ACCESS = "rank_vectors_script_access";
/** Initial support for rank-vectors maxSim functions access. */
private static final String RANK_VECTORS_SCRIPT_MAX_SIM = "rank_vectors_script_max_sim_with_bugfix";
/** Fixed the math in {@code moving_fn}'s {@code linearWeightedAvg}. */
private static final String MOVING_FN_RIGHT_MATH = "moving_fn_right_math";

private static final String RANDOM_SAMPLER_WITH_SCORED_SUBAGGS = "random_sampler_with_scored_subaggs";
private static final String OPTIMIZED_SCALAR_QUANTIZATION_BBQ = "optimized_scalar_quantization_bbq";
Expand All @@ -59,6 +61,7 @@ private SearchCapabilities() {}
capabilities.add(RANDOM_SAMPLER_WITH_SCORED_SUBAGGS);
capabilities.add(OPTIMIZED_SCALAR_QUANTIZATION_BBQ);
capabilities.add(KNN_QUANTIZED_VECTOR_RESCORE);
capabilities.add(MOVING_FN_RIGHT_MATH);
if (RankVectorsFieldMapper.FEATURE_FLAG.isEnabled()) {
capabilities.add(RANK_VECTORS_FIELD_MAPPER);
capabilities.add(RANK_VECTORS_SCRIPT_ACCESS);
Expand Down

0 comments on commit 687d3df

Please sign in to comment.