Skip to content

Refactored Unit Test Startup and Teardown #916

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

Merged
merged 5 commits into from
Mar 4, 2022
Merged

Conversation

maxcapodi78
Copy link
Collaborator

Now EDB tests and all tests that doesn't need AEDT runs before the others and outside the desktop

@codecov
Copy link

codecov bot commented Mar 4, 2022

Codecov Report

Merging #916 (5eeb572) into main (7202b92) will decrease coverage by 0.04%.
The diff coverage is 53.48%.

@@            Coverage Diff             @@
##             main     #916      +/-   ##
==========================================
- Coverage   80.15%   80.11%   -0.05%     
==========================================
  Files         128      128              
  Lines       37242    37244       +2     
==========================================
- Hits        29851    29837      -14     
- Misses       7391     7407      +16     

Copy link
Contributor

@Alberto-DM Alberto-DM left a comment

Choose a reason for hiding this comment

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

Good improvement for test stability.
Made some comments on unclear parts.

def my_teardown(self, close_desktop=False):
if close_desktop and not is_ironpython:
d = Desktop(desktop_version, non_graphical, False)
d.release_desktop()
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add also del self.aedtapps and del self.edbapps.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done. Thanks


def add_app(self, project_name=None, design_name=None, solution_type=None, application=None):
if "oDesktop" not in dir(sys.modules["__main__"]):
if self.aedtapps:
self.aedtapps[0].release_desktop()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a safety mechanism?
I don't get when it will execute this release_desktop

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

you are right. it should be in the teardown method.

Comment on lines 185 to 187
# desktop = Desktop(desktop_version, non_graphical, new_thread)
# desktop.disable_autosave()
# yield desktop
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# desktop = Desktop(desktop_version, non_graphical, new_thread)
# desktop.disable_autosave()
# yield desktop

Comment on lines 189 to 190
# If new_thread is set to false by a local_config, then don't close the desktop.
# Intended for local debugging purposes only
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# If new_thread is set to false by a local_config, then don't close the desktop.
# Intended for local debugging purposes only

Comment on lines 191 to 192
# if new_thread or os.name == "posix":
# desktop.close_desktop()
Copy link
Collaborator

Choose a reason for hiding this comment

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

@maxcapodi78 It is not required anymore to have this new-thread for local debugging session?

Suggested change
# if new_thread or os.name == "posix":
# desktop.close_desktop()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks

@maxcapodi78 maxcapodi78 merged commit 8cabdd2 into main Mar 4, 2022
@maxcapodi78 maxcapodi78 deleted the UnitTestSpeedup branch March 4, 2022 15:11
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