Skip to content

fix: make test_script.py directory portable and configurable - #113

Open
muskan-creates352 wants to merge 1 commit into
eellak:masterfrom
muskan-creates352:fix/test-script-portable-dir
Open

muskan-creates352 wants to merge 1 commit into
eellak:masterfrom
muskan-creates352:fix/test-script-portable-dir

Conversation

@muskan-creates352

Copy link
Copy Markdown

Description

Resolves #112

In test_script.py (line 12), the test directory was previously hardcoded to an absolute personal local developer directory (/home/fivos/CascadeProjects/glossAPI/corpus_test), causing a FileNotFoundError when executed on external environments.

This PR makes test_script.py portable by:

  1. Dynamically resolving the repository root relative to __file__.
  2. Defaulting to the repository's sample lightweight PDF corpus (samples/lightweight_pdf_corpus/pdfs) and writing outputs to artifacts/test_run.
  3. Supporting path overrides via the GLOSSAPI_TEST_DIR environment variable or a command-line argument (python test_script.py /path/to/corpus).

Changes

  • test_script.py: Added get_test_dirs() helper to dynamically resolve input and output directories with fallback to sample data.

Testing

  • Verified python test_script.py resolves directories out of the box without requiring manual path edits.

Replaces the hardcoded personal developer path in test_script.py with a dynamic path pointing to the repository's sample lightweight PDF corpus, with support for GLOSSAPI_TEST_DIR environment variable or CLI argument overrides. Fixes eellak#112

This branch has not been deployed

No deployments
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.

[Bug] Hardcoded personal developer path in test_script.py causes FileNotFoundError

1 participant