Skip to content
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

F!! Add auto approve reporter based on system properties #447

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zabetak
Copy link

@zabetak zabetak commented Dec 14, 2023

Description

The new reporter will automatically approve the changeset (copy received to approved) when a specified System property is set (to true or it is simply present).

The goal is to allow to update easily all relevant files from the tests that are run, without requiring code changes but in a controlled manner (only when the user explicitly sets the property).

The new auto approver would be very useful for projects using maven, gradle, etc, where system properties can be passed along when running a test. For instance:

mvn test -Dtest=TestMySuperExampleUsingApproval -Dorg.approvaltests.reporters.autoapprove (triggers the auto approver and creates/updates the .aproved files)
mvn test -Dtest=TestMySuperExampleUsingApproval (doesn't trigger the auto approver and if files do not match it simply fails)

The new reporter will automatically approve the changeset (copy
received to approved) when a specified System property is set (to true
or it is simply present).

The goal is to allow to update easily all relevant files from the tests
that are run, without requiring code changes but in a controlled manner
(only when the user explicitly sets the property).
@LarsEckart
Copy link
Contributor

hey, we're back doing weekly sessions to work on ApprovalTests. Would you like to join on a Monday evening (18-20 o'clock), walk us through this PR and get this merged?

@zabetak
Copy link
Author

zabetak commented Jan 16, 2024

Monday 22/1 at 19:00 GMT +1 is fine with me. Feel free to send me an invite at zabetak@gmail.com

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.

None yet

2 participants