Skip to content

Update fw_testing pytest integration to include using default configuration file#286

Open
bevinduckett wants to merge 5 commits intonasa:develfrom
bevinduckett:fprime-test-api-config
Open

Update fw_testing pytest integration to include using default configuration file#286
bevinduckett wants to merge 5 commits intonasa:develfrom
bevinduckett:fprime-test-api-config

Conversation

@bevinduckett
Copy link
Contributor

Related Issue(s) nasa/fprime#4770
Has Unit Tests (y/n) No
Documentation Included (y/n) y (code comments)

Change Description

  1. Updated fprime_test_api_session in pytest_integration.py to include default GDS configuration using the ConfigDrivenParser class
  2. Updated ConfigDrivenParser class to check the FPRIME_GDS_CONFIG_PATH as part of its default behavior (previously the default file path was included in the class implementation but the environment variable override of that path was only checked in run_deployment.py)

Rationale

The rationale for updating fprime_test_api_session was so that running pytest would pick up the same GDS defaults as fprime-gds - without that feature in my environment, we'd need to have a bunch of different pytest configuration files to ensure the correct dictionary got used for different deployments being tested

Updating the ConfigDrivenParser class was required to avoid environment variable name that could override the default configuration path being specified and handled in multiple locations (previously only in run_deployment.py, but the updates to pytest_integration.py would've also required it)

Testing/Review Recommendations

To test:

  1. Create a fprime-gds.yml with unique configuration in a directory with tests, run pytest and verify those settings are picked up
  2. Create a fprime-gds.yml in a different location, set the FPRIME_GDS_CONFIG_PATH environment variable with the path to that file, run pytest and verify those settings are picked up
  3. Verify pytest uses normal defaults when FPRIME_GDS_CONFIG_PATH is not set and there's no prime-gds.yml in the current directory

Future Work

Note any additional work that will be done relating to this issue.

Updated ConfigDrivenParser to always check & give preference to the environment variable setting the configuration path . Also updated the class to add a function to the command line options from the config file without needing to parse all the options
Moved checking the FPRIME_GDS_CONFIG_PATH  environment variable from this file into the ConfigDrivenParser class
if dictionaries.constant_name:
for name, value in dictionaries.constant_name.items():
config.set_constant(name, value)
args.dictionaries = dictionaries
Copy link
Collaborator

Choose a reason for hiding this comment

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

This blob of change looks like a recent change has been reverted - you likely branched off before it was made. Could we revert it back to the current devel state?

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