feat(scenarios): assert-based scenarios + 5 new scenarios + report comparison#101
Merged
Conversation
…ort comparison Closes #87
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 5 new scenarios that use rich assertions (from Issue #86), bringing the total to 15 scenarios. Also adds
compareScenarioReports()for regression testing.New Scenarios
slow-csms-response— CSMS takes 15s to respond to BootNotification. Usestimingassertion.meter-anomaly— Meter values decrease (non-monotonic). Usespayload_fieldandevent_countassertions.short-session— Session lasts 10s. Usessession_stateandevent_countassertions.heartbeat-irregular— Heartbeats at 600s vs 300s expected. Usesevent_countassertion.unresponsive-csms— CSMS never responds to BootNotification. Usesfailure_severityandfailure_countassertions.Report Comparison
Compares two scenario evaluation results — useful for regression testing.
Files Changed
packages/toolkit/src/scenarios/__scenarios__/slow-csms-response.ts— newpackages/toolkit/src/scenarios/__scenarios__/meter-anomaly.ts— newpackages/toolkit/src/scenarios/__scenarios__/short-session.ts— newpackages/toolkit/src/scenarios/__scenarios__/heartbeat-irregular.ts— newpackages/toolkit/src/scenarios/__scenarios__/unresponsive-csms.ts— newpackages/toolkit/src/scenarios/compare.ts— new comparison modulepackages/toolkit/src/scenarios/compare.test.ts— 6 testspackages/toolkit/src/scenarios/index.ts— register 5 new scenarios + exportcompareScenarioReportspackages/toolkit/src/scenarios/index.test.ts— updated for 15 scenarios + v0.3 failure codestests/external-fixture/test.mjs— updated scenario count to 15.changeset/v03-scenarios-assertions.md— minor bump changesetCURRENT_STATE.md— updated with v0.3.0 progressCloses #87
Checklist
Scenariotype extended with optionalassertionsfield (done in feat(core): rich scenario assertions #86)compareScenarioReports()implemented withScenarioComparisonreturn typeCURRENT_STATE.mdupdated