Skip to content

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 [email protected]

@maio
Copy link
Contributor

maio commented Aug 21, 2024

@zabetak
Copy link
Author

zabetak commented Sep 3, 2024

Thanks for info @maio ! In a similar manner maybe it would be useful to allow to configure reporters via system properties.

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