Skip to content

Hardcoded paths in test suite #2

Description

@pdalloz

ls -l command run during test suite shows paths for modules, which change according to the environment name.

FIX OPTIONS:

  • change width setting prior to ls -l tests so paths aren't output during the tests
  • write a test preprocessor script that amends transcript file: transcript_debugPob_all_4be16d15420a432bb7ad09af88b0c001.txt
    • Maybe replace paths output during test by regex patterns for cmd2 test. I've already done something similar with object id's
    • Maybe replace paths in target transcript_debugPob_all_4be16d15420a432bb7ad09af88b0c001 with equivalent hardcoded paths derived from current environment

How I run the tests

    python /Users/peterdalloz/Dropbox/PYTHONDROPBOX/pobshell_publish/Use_Cases/debugPob_all.py --test /Users/peterdalloz/Dropbox/PYTHONDROPBOX/pobshell_publish/Transcript_Tests/transcript_debugPob_all_4be16d15420a432bb7ad09af88b0c001.txt

If the test fails I check if it's because of path changes between environments

Here is how I create a new transcript output for diff comparison

python /Users/peterdalloz/Dropbox/PYTHONDROPBOX/pobshell_publish/Use_Cases/debugPob_all.py 'run_script  Transcript_Tests/script_debugPob_all_4be16d15420a432bb7ad09af88b0c001.txt -t /Users/peterdalloz/Dropbox/PYTHONDROPBOX/pobshell_publish/Transcript_Tests/transcript_debugPob_all_20250620_c001b.txt' 'killsession'

Then compare new version transcript_debugPob_all_20250620_c001b.txt with known-correct original:
I use Beyond Compare

bcomp /Users/peterdalloz/Dropbox/PYTHONDROPBOX/pobshell_publish/Transcript_Tests/transcript_debugPob_all_20250620_c001b.txt  /Users/peterdalloz/Dropbox/PYTHONDROPBOX/pobshell_publish/Transcript_Tests/transcript_debugPob_all_4be16d15420a432bb7ad09af88b0c001.txt

If the diff is only hardcoded paths, I consider the test successful

N.B. Not sure where I should document the other tests I run.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions