Skip to content

[E2E] Validate e2e comparison configuration before the simulation runs - #3273

Open
matthew7838 wants to merge 44 commits into
devfrom
e2e-prevalidation
Open

matthew7838 wants to merge 44 commits into
devfrom
e2e-prevalidation

Conversation

@matthew7838

@matthew7838 matthew7838 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Validates the end-to-end testing configuration before the simulation runs, so a configuration mistake fails the task in seconds instead of after the full run.

Context

Issue(s) closed by this pull request: closes #3222

What

  • Adds E2ETestResultsHandler.validate_comparison_configuration() and validate_update_configuration(), called at the start of the END_TO_END_TESTING and UPDATE_E2E_TEST_RESULTS tasks before the simulation.
  • Extracts _load_expected_results_file() (used by the validation and the comparison) and _validate_result_path_set().

Why

The paths the comparison and the update use afterwards (must-change files, expected-results files, conversion CSV, actual results prefixes) were only read once the simulation had finished, so a bad path or a mistyped flagged name surfaced at the end of the task.

How

Before the simulation, every result path set is checked: the expected-results file must exist, be valid JSON with an expected_results entry, and sit in the task's filters directory, and actual_results_path must be a prefix of the {output_prefix}_saved_variables_{filter name}_ file name the run writes. For the comparison task the must-change files and the conversion table must also load, and every flagged name must be a key of some domain's expected results. For the update task the file must also contain the keys the update writes back. Failures are logged and raised, so the task terminates before the simulation.

Test plan

  • Unit tests for both validations (valid configurations; unknown flagged name; missing or invalid must-change, expected-results, and conversion files; expected-results file outside the filters directory; mismatched actual_results_path) and for TaskManager (validation runs before the simulation for both tasks; a failure skips the simulation and the comparison or update).
  • Real runs: a mistyped flagged name, expected_results_path, or actual_results_path fails the comparison task in ~4 s before the simulation, and a mistyped expected_results_path fails the update task the same way.

Input Changes

  • N/A

Output Changes

  • N/A

matthew7838 and others added 7 commits September 11, 2026 16:12
Adds E2ETestResultsHandler.validate_comparison_configuration(), called
at the start of the END_TO_END_TESTING task, so a bad expected results
path, an invalid must-change or expected results file, a bad conversion
table, or a flagged name missing from every domain's expected results
fails the task in seconds instead of after the full simulation. The
comparison-time checks stay in place as a backstop.
@matthew7838 matthew7838 changed the title Validate e2e comparison configuration before the simulation runs [E2E] Validate e2e comparison configuration before the simulation runs Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on e2e-prevalidation branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on e2e-prevalidation branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

matthew7838 and others added 3 commits September 11, 2026 18:44
…fore the simulation

Extends the pre-simulation validation to every path the comparison and
the expected results update use afterwards: each expected results file
must be valid and sit in the task's filters directory, and each
actual_results_path must be a prefix of the results file name the run
writes. The UPDATE_E2E_TEST_RESULTS task now validates its configuration
before the simulation as well.
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on e2e-prevalidation branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on e2e-prevalidation branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

matthew7838 and others added 3 commits September 14, 2026 18:06
The shared loader only requires an expected_results entry, as the
comparison did on dev. validate_update_configuration checks for the
keys that update_expected_test_results writes back.
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on e2e-prevalidation branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on e2e-prevalidation branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

@matthew7838 matthew7838 self-assigned this Sep 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on e2e-prevalidation branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on e2e-prevalidation branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on e2e-prevalidation branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on e2e-prevalidation branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

@allisterakun allisterakun left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

"""
om = OutputManager()
info_map: dict[str, Any] = {
"class": E2ETestResultsHandler.__class__.__name__,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"class": E2ETestResultsHandler.__class__.__name__,
"class": E2ETestResultsHandler.__name__,

E2ETestResultsHandler.__class__.__name__ gives "type"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do a search and make sure to correct all occurrences

"""
om = OutputManager()
info_map: dict[str, Any] = {
"class": E2ETestResultsHandler.__class__.__name__,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"class": E2ETestResultsHandler.__class__.__name__,
"class": E2ETestResultsHandler.__name__,

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on e2e-prevalidation branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

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.

[E2E] Validate comparison configuration before the simulation runs

2 participants