Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Remove overlapping inputForm=LowForm tests #1753

Merged
merged 2 commits into from
Jul 16, 2020
Merged

Conversation

seldridge
Copy link
Member

@seldridge seldridge commented Jul 10, 2020

Remove tests from LoweringCompilerSpec testing the placement of
inputForm=LowForm legacy, custom transforms. This behavior is already
tested in the CustomTransformSpec.

Refactor the test used in the CustomTransformSpec to assert that
inputForm=LowForm legacy transforms run right before the emitter (see
note below!). The new test looks only for a list of (customTransform,
emitter) in a sliding, size-2 window of the flattened transform order.
Previously, this was looking for a match before and after the custom
transform. The old implementation necessitate busywork updates of the
test when new transforms are added that changed the transform running
before the custom transform.

Note: this test, as written is intentionally wrong. When verification
statements were added, the test was changed to not do what it's
supposed to do. Namely, the test is supposed to ensure that an
inputForm=LowForm transform runs immediately before its emitter.
However, the test is actually checking that the custom transform runs
before transforms that convert and remove verification statements. I'm
intentionally leaving the test broken, but doing the refactor in order
to make this easier to manually backport to the 1.3.x branch.

This should backport to 1.3.x.

Contributor Checklist

  • [n/a] Did you add Scaladoc to every public function/method?
  • [n/a] Did you update the FIRRTL spec to include every new feature/behavior?
  • [n/a] Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • code cleanup

API Impact

None.

Backend Code Generation Impact

None.

Desired Merge Strategy

  • Rebase: You will rebase the PR onto master and it will be merged with a merge commit.

Release Notes

None.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (1.2.x, 1.3.0, 1.4.0) ?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

@seldridge seldridge requested a review from a team as a code owner July 10, 2020 20:54
@seldridge seldridge added this to the 1.3.x milestone Jul 16, 2020
@seldridge seldridge added enhancement Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI. labels Jul 16, 2020
@seldridge seldridge force-pushed the rm-duplicate-tests branch from 91e872f to 0872e03 Compare July 16, 2020 16:50
@seldridge seldridge added Merge Commit Please This branch has useful history, please merge with a merge commit and removed Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI. labels Jul 16, 2020
Remove tests from LoweringCompilerSpec testing the placement of
inputForm=LowForm legacy, custom transforms. This behavior is already
tested in the CustomTransformSpec.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Refactor the test used in the CustomTransformSpec to assert that
inputForm=LowForm legacy transforms run right before the emitter (see
note below!). The new test looks only for a list of (customTransform,
emitter) in a sliding, size-2 window of the flattened transform order.
Previously, this was looking for a match before and after the custom
transform. The old implementation necessitate busywork updates of the
test when new transforms are added that changed the transform running
before the custom transform.

Note: this test, as written is intentionally wrong. When verification
statements were added, the test was changed to not do what it's
supposed to do. Namely, the test is supposed to ensure that an
inputForm=LowForm transform runs immediately before its emitter.
However, the test is actually checking that the custom transform runs
before transforms that convert and remove verification statements. I'm
intentionally leaving the test broken, but doing the refactor in order
to make this easier to manually backport to the 1.3.x branch.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
@seldridge seldridge force-pushed the rm-duplicate-tests branch from 0872e03 to debee42 Compare July 16, 2020 16:52
@sequencer sequencer self-requested a review July 16, 2020 17:54
Copy link
Member

@sequencer sequencer left a comment

Choose a reason for hiding this comment

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

LGTM :)

@seldridge seldridge merged commit da221ea into master Jul 16, 2020
@mergify mergify bot added the Backported This PR has been backported to marked stable branch label Jul 16, 2020
@seldridge seldridge deleted the rm-duplicate-tests branch July 17, 2020 01:06
seldridge added a commit that referenced this pull request Jul 17, 2020
Remove overlapping inputForm=LowForm tests (bp #1753)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Backported This PR has been backported to marked stable branch enhancement Merge Commit Please This branch has useful history, please merge with a merge commit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants