Skip to content

service: Include TS code module dir in .env search#485

Merged
dixonjoel merged 8 commits intomainfrom
users/bkeryan/teststand-env-path
Oct 30, 2023
Merged

service: Include TS code module dir in .env search#485
dixonjoel merged 8 commits intomainfrom
users/bkeryan/teststand-env-path

Conversation

@bkeryan
Copy link
Copy Markdown
Collaborator

@bkeryan bkeryan commented Oct 28, 2023

What does this Pull Request accomplish?

Update .env search to include some fallback options if the current directory and its parents don't contain a .env file:

  • For PyInstaller, use the EXE path
  • For scripts that have a __main__ module that exists on disk, use the script path
  • For TestStand code modules (and possibly other cases), use the path of the topmost caller that isn't part of ni_measurementlink_service

Why should this Pull Request be merged?

Fixes AB#2565326

What testing has been done?

Ran tests.
Manually tested with nidcpower_source_dc_voltage TestStand sequence.

@bkeryan
Copy link
Copy Markdown
Collaborator Author

bkeryan commented Oct 28, 2023

@mshafer-NI This implements some of the ideas we discussed earlier.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 28, 2023

Test Results

       40 files  ±    0         40 suites  ±0   44m 24s ⏱️ - 2m 3s
     484 tests +    5       484 ✔️ +    5         0 💤 ±0  0 ±0 
16 310 runs  +200  14 710 ✔️ +200  1 600 💤 ±0  0 ±0 

Results for commit c2b3a9c. ± Comparison against base commit 17aaf3e.

♻️ This comment has been updated with latest results.

Comment thread tests/unit/test_dotenvpath.py
Comment thread tests/unit/test_dotenvpath.py Outdated
Comment thread ni_measurementlink_service/_dotenvpath.py Outdated
Comment thread tests/unit/test_dotenvpath.py
@dixonjoel dixonjoel merged commit 92f5abe into main Oct 30, 2023
@dixonjoel dixonjoel deleted the users/bkeryan/teststand-env-path branch October 30, 2023 13:57
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