mbeddr.core icon indicating copy to clipboard operation
mbeddr.core copied to clipboard

Pull AssertSnapshotEquals from YSA into mpsutils

Open abstraktor opened this issue 4 years ago • 2 comments

This assertion for strings keeps the expected text in a property and provides a merge view to update it with the actual assertion value.

Motivation

Tests that aim to make changes on long texts inertial and conscious. A typical use case is serialization.

Example Scenario

Given I run such assertion in my local MPS And the snapshot differs from the actual value When I open the assertion and hit F4 to refresh the editor Then I see a link "Update Snapshot" appeared When I click that link Then I see a merge view And the left hand side shows the expected snapshot that is stored in the assertion And the right hand side shows the actual value which the expression has returned on the last test run Given I merge all differences into the middle When I save the merge Then the snapshot got updated When rerun the test Then the test will be green

grafik grafik

For more details, see this video

Showcase video

Todos

  • consider if memory consumption of this is an issue
  • [ ] consider refreshing the assertions editors when remembering unequalities AssertSnapshotEqualsStorage to avoid confusion when forgetting the F5
  • [ ] remove updateOnNextRun if still unused
  • [ ] move it from YSA to mpsutils (it consists of the AssertSnapshotEquals with its aspects, the runtime class AssertSnapshotEqualsStorage, and the test for the assertion AssertSnapshotEqualsStorage_Test)
  • [ ] possibly fix behavior of new created assert snapshot equals with empty snapshot

abstraktor avatar Jun 19 '20 12:06 abstraktor

(as a sidenote: the code there is still on feature/threaten-channels and awaiting to be merged to master)

abstraktor avatar Jun 19 '20 12:06 abstraktor

in between, the code at the YSA-side has been merged to master.

@kbirken Any thoughts on whether the infrastructure-team can help me out here? (And to what extent?)

abstraktor avatar Jun 29 '20 14:06 abstraktor