-
Notifications
You must be signed in to change notification settings - Fork 18
feat: Add support for custom configuration files in test projects #54
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
base: main
Are you sure you want to change the base?
Conversation
Add optional parameters to Initialize() method allowing tests to use custom-named configuration files (local.settings.json, parameters.json, connections.json) located in the test project instead of the Logic App project. Key Features: - Optional parameters: localSettingsFilename, parametersFilename, connectionsFilename - File resolution checks test project first, then falls back to Logic App project - Enables unified test suites across environments (DEV/QA/PROD) using the same test code with different configuration files - Maintains full backward compatibility with existing tests Changes: - Added Initialize() method overload with optional configuration parameters - Added ResolveConfigurationFilePath() helper method for file resolution - Updated ProcessLocalSettingsFile(), ProcessParametersFile(), and ProcessConnectionsFile() to accept custom filenames - Created example test classes demonstrating the feature - Updated project version to 1.13.0 Examples: - parameters-dev.json, parameters-qa.json, parameters-prod.json - local.settings-custom.json, connections-custom.json
- Add optional parameters to Initialize() for custom config filenames: * localSettingsFilename: Custom local settings file * testProjectPath: Path to test project directory * parametersFilename: Custom parameters file * connectionsFilename: Custom connections file - Configuration file resolution precedence: * Initialize() parameter → testConfiguration.json → default * Custom files search test project first, then Logic App project * Custom files are copied to standard names for Logic App runtime - Consolidate duplicate file processing logic: * Created ProcessConfigurationFile() helper method * Enhanced ResolveConfigurationFilePath() to return tuple with source info * Reduced code duplication by ~60% in file processing section - Fix testConfiguration.json structure: * Move localSettingsFilename to root level (not inside workflow section) * Ensures proper configuration loading for default test behavior - Copy behavior: * Custom files from test project are copied to testConfiguration.json
|
@shadhajSH @mark-abrams @sanket-borhade Could you take a look at this PR. This PR adds flexible support for custom configuration files in LogicAppUnit test projects, allowing a single test suite to target multiple Logic App projects. It introduces optional Initialize() parameters, improved file-resolution logic, and consolidated config-processing code. Default behavior remains unchanged, and new sample tests demonstrate how custom configs can be used effectively. All existing tests pass, with no breaking changes introduced.
|
|
Hi @imdj360 , thank you for your contribution. I will take a look. |
|
@mark-abrams - Could you please validate these findings? The issue appears to be platform-dependent and unrelated to the custom configuration code changes in this PR.
Testing Update - macOS Verification Main Branch (v1.12.0) - Baseline Test PR #54 Branch (dynamicparameterjson) This issue: Pre-exists on main branch v1.12.0 |




Add optional parameters to Initialize() method allowing tests to use custom-named configuration files (local.settings.json, parameters.json, connections.json) located in the test project instead of the Logic App project.
Key Features:
Changes:
Examples: