Skip to content

Conversation

MarvinSchenkel
Copy link
Contributor

@MarvinSchenkel MarvinSchenkel commented May 8, 2025

This PR adds the possibility to mock error messages coming from ActivityResults with the status of FAILED. This will allow users to evaluate expression that depend on the error message, for example:

@contains(activity('Fetch some resources').Error.message, 'The specified resource does not exist.')

@arjendev
Copy link
Collaborator

arjendev commented May 8, 2025

Hi @MarvinSchenkel,

Awesome addition, we definitely missed this error attribute. Would you be able to test this functionality by adding another test case in tests/unit/functions/test_data_factory_testing_framework_expression_evaluator.py as a param of def test_evaluate.

That would be great, thanks for the work!

@arjendev arjendev requested a review from LeonardHd May 8, 2025 14:30
@MarvinSchenkel
Copy link
Contributor Author

MarvinSchenkel commented May 9, 2025

Hi @MarvinSchenkel,

Awesome addition, we definitely missed this error attribute. Would you be able to test this functionality by adding another test case in tests/unit/functions/test_data_factory_testing_framework_expression_evaluator.py as a param of def test_evaluate.

That would be great, thanks for the work!

Happy to! However, having some issue with getting the tests to run locally. What I did:

  • Installed the project with poetry install --with dev
  • Running tests with: poetry run coverage run --source=src -m pytest .
  • Error: ModuleNotFoundError: No module named 'data_factory_testing_framework'
  • Installed the project in editable mode: pip install -e "."
  • Error: ModuleNotFoundError: No module named 'Microsoft.Azure'
  • On MacOS with dotnet --version: 8.0.407
  • When setting coreclr as the PYTHONNET_RUNTIME, I can import basic .NET classes:
>>> from System import String
>>> String
<class 'System.String'>

However:

>>> import Microsoft.Azure
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'Microsoft.Azure'

Any idea?

EDIT: dotnet build is required to build the project locally and adding the required .NET dependencies. I will update the dev docs to make this a bit more clear.

@MarvinSchenkel
Copy link
Contributor Author

@microsoft-github-policy-service agree

Copy link
Collaborator

@arjendev arjendev left a comment

Choose a reason for hiding this comment

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

@MarvinSchenkel, thank you for your contribution!

@arjendev arjendev removed the request for review from LeonardHd May 9, 2025 12:18
@arjendev arjendev merged commit d72a73c into microsoft:main May 12, 2025
25 checks passed
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.

3 participants