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

create temp dir and use it for session dir in tests #335

Merged
merged 3 commits into from
Nov 17, 2021
Merged

Conversation

Konboi
Copy link
Contributor

@Konboi Konboi commented Nov 12, 2021

A session file that was created in this repo's CI was deleted by tests (by clean_test_session_files method)
Then, two test sessions were created 1) subset command, 2) record test command but it's not intented.

So I create a temp dir and use it in test to avoid deleting a session file that this repository created in CI.

To avoid delete a session file that this repository created in CI.
@Konboi Konboi requested a review from ninjinkun November 12, 2021 06:02
@@ -48,6 +51,7 @@ def setUp(self):

def tearDown(self):
clean_session_files()
del os.environ[SESSION_DIR_KEY]
Copy link
Contributor

@ninjinkun ninjinkun Nov 12, 2021

Choose a reason for hiding this comment

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

With tempfile.mkdtemp, you need to clean up the temp directory manually https://stackoverflow.com/questions/6884991/how-to-delete-a-directory-created-with-tempfile-mkdtemp/55871731

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed it

@Konboi Konboi force-pushed the fix-extra-session branch 2 times, most recently from c844dbc to 340de21 Compare November 17, 2021 02:55
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Konboi Konboi requested a review from ninjinkun November 17, 2021 03:06
Copy link
Contributor

@ninjinkun ninjinkun left a comment

Choose a reason for hiding this comment

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

LGTM. Kudos for your python 3.6 workaround 👍

if: matrix.python-version == '3.6'
run: |
python -m pip install --upgrade pip
pip install pipenv==2021.11.5
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Konboi Konboi merged commit ee56207 into main Nov 17, 2021
@Konboi Konboi deleted the fix-extra-session branch November 17, 2021 03:14
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.

2 participants