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

adds diff back on error #76

Merged
merged 5 commits into from
Mar 27, 2023
Merged

Conversation

jakecoffman
Copy link
Member

@jakecoffman jakecoffman commented Mar 10, 2023

This is another attempt to add diffs back to the CLI output when a test fails. See #42 for a previous try.

This time I've added it to the very end of the run, as if you had run diff against the output result and the input. Here's a small example:

INFO Results:
+-----------------------------------------------------------+
|            Changes to Dependabot Pull Requests            |
+---------+-------------------------------------------------+
| created | github.com/fatih/color ( from 1.7.0 to 1.13.0 ) |
+---------+-------------------------------------------------+
time="2023-03-10T16:07:13Z" level=info msg="15/145 calls cached (10%)"
--- ../smoke-tests/tests/smoke-go.yaml
+++ result.txt
@@ -97,7 +97,7 @@
     - type: create_pull_request
       expect:
         data:
-            base-commit-sha: 941c9223edd97d1234567890a404d038a4bc846c4
+            base-commit-sha: 941c9223edd97d233737435a404d038a4bc846c4
             dependencies:
                 - name: github.com/fatih/color
                   previous-requirements:
@@ -227,6 +227,7 @@
                 Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.7.0 to 1.13.0.
                 - [Release notes](https://github.com/fatih/color/releases)
                 - [Commits](https://github.com/fatih/color/compare/v1.7.0...v1.13.0)
+            grouped-update: false
     - type: mark_as_processed
       expect:
         data:

2023/03/10 10:07:13 update failed expectations

Previous attempts put the diff inline which made it hard to follow what was going on.

@jakecoffman jakecoffman marked this pull request as ready for review March 22, 2023 15:36
@jakecoffman jakecoffman requested a review from a team as a code owner March 22, 2023 15:36
internal/infra/run.go Outdated Show resolved Hide resolved
Co-authored-by: Landon Grindheim <[email protected]>
@jakecoffman jakecoffman merged commit d9dd2f3 into main Mar 27, 2023
@jakecoffman jakecoffman deleted the jakecoffman/add-diffs-back-part-2 branch March 27, 2023 15:11
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.

2 participants