Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix layout bug and add tests #108

Merged
merged 12 commits into from
Jul 19, 2023
Merged

Fix layout bug and add tests #108

merged 12 commits into from
Jul 19, 2023

Conversation

phschaad
Copy link
Collaborator

@phschaad phschaad commented Jul 14, 2023

  • Adds tests using the testing framework Jest
  • Tests the integrated graph library
  • Adds some tests for the vertical layout (specifically, the ranking phase)
  • Fixes a few bugs detected through testing, including mishandling of self-loops
  • Ensure the vertical layout doesn't get stuck if it fails due to some reason

@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2023

Codecov Report

❗ No coverage uploaded for pull request base (master@248a55c). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master     #108   +/-   ##
=========================================
  Coverage          ?   90.73%           
=========================================
  Files             ?        7           
  Lines             ?      820           
  Branches          ?      155           
=========================================
  Hits              ?      744           
  Misses            ?       59           
  Partials          ?       17           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@phschaad phschaad requested a review from tbennun July 19, 2023 08:20
Copy link
Contributor

@tbennun tbennun left a comment

Choose a reason for hiding this comment

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

Looks great, I only have some questions and a test request. Great work with the testing infrastructure!

}

public get length(): number {
return this._nodes.size;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please explain

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added comment

@@ -121,7 +125,7 @@ export class Graph<NodeT, EdgeT> implements GraphI<NodeT, EdgeT> {
}

public numberOfEdges(): number {
return this.edges().length;
return this.edges().length / 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, explain

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added comment

tests/unit/layouter/graphlib/algorithms/cycles.test.ts Outdated Show resolved Hide resolved
test(
'Nested loops with fused assignment and condition edges',
testNestedLoopsFusedEdes
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a test for a self edge loop

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added

@phschaad phschaad requested a review from tbennun July 19, 2023 16:59
Copy link
Contributor

@tbennun tbennun left a comment

Choose a reason for hiding this comment

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

LGTM!

@phschaad phschaad merged commit 4267ba6 into master Jul 19, 2023
2 checks passed
@phschaad phschaad deleted the testing_and_bugfixes branch July 19, 2023 17:04
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.

3 participants