PoC: Loading test config from a central service #968
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A draft PR in MSAL Python introduced a new concept of how to set up automated testing: AzureAD/microsoft-authentication-library-for-python#825
Essentially, configuration for how to set up constants, applications, token calls, assertions, and more is all stored in a central service that every MSAL can access, allowing us to create new tests in every library simply by creating new configuration file that is processed by generic "runners" in each MSAL.
This PR achieves this by introducing a few new classes:
RunnerTest
: Essentially just unit tests that retrieve configuration files and executes helper methods based on the contentsRunnerHelper
: A set of helper methods to create MSAL objects based on the contents of a configuration fileRunnerJsonHelper
: A set of helper methods to parse the configuration fileShortcuts
: As the name implies, some shortcuts that were taken just to make this POC quicker and easierFor this first-draft review:
RunnerTest
andRunnerHelper
are pretty representative of what a final implementation would look like, as they mostly just need to be expanded to cover more scenariosRunnerJsonHelper
will likely be replaced by a more generic version that can handle any config file and reuse behavior in the library's existingJsonHelper
Shortcuts
an essentially be ignored during a review, since none of it would be part of a 'real' implementation