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 Create Files Unit Test #1117

Merged
merged 4 commits into from
Jul 13, 2023
Merged

Fix Create Files Unit Test #1117

merged 4 commits into from
Jul 13, 2023

Conversation

Satrat
Copy link
Contributor

@Satrat Satrat commented Jul 12, 2023

check_for_created_files() is intended to insure large extraneous files(i.e from LLMs) aren't left in the root directory when running tests. This test case was failing due to __pycache__ files and prometheus logs. These files are small so it should be fine that they are created. To fix the test I filtered out the __pycache__ directories and prometheus_logs.prom files from the added files check, in addition to the GHA files that were already accounted for.

Testing Instructions

Run make clean then make test

Previous Output

# root directory: /home/ubuntu/workspace/Github/TestDeepsparse/deepsparse/
E       AssertionError: 5 files created in current working directory during pytest run. Created files: 
{'/home/ubuntu/workspace/Github/TestDeepsparse/deepsparse/tests/deepsparse/pipelines/dynamic_import_modules/__pycache__/valid_dynamic_import.cpython-38.pyc', 
'/home/ubuntu/workspace/Github/TestDeepsparse/deepsparse/tests/deepsparse/pipelines/dynamic_import_modules/__pycache__/no_task.cpython-38.pyc', 
'/home/ubuntu/workspace/Github/TestDeepsparse/deepsparse/test_instantiate_prometheus0/prometheus_logs.prom', 
'/home/ubuntu/workspace/Github/TestDeepsparse/deepsparse/prometheus_logs.prom', 
'/home/ubuntu/workspace/Github/TestDeepsparse/deepsparse/tests/deepsparse/pipelines/dynamic_import_modules/__pycache__/no_register.cpython-38.pyc'}

Updated Output

No assertion thrown

@Satrat Satrat changed the title [WIP] Fix Create Files Test Fix Create Files Unit Test Jul 12, 2023
Copy link
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

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

nice improvement with allowed_created_files

Copy link
Contributor

@dbogunowicz dbogunowicz left a comment

Choose a reason for hiding this comment

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

Excellent!

@Satrat Satrat merged commit 3794483 into main Jul 13, 2023
7 checks passed
@Satrat Satrat deleted the fix-create-files-test branch July 13, 2023 13:18
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.

None yet

3 participants