-
Notifications
You must be signed in to change notification settings - Fork 357
test(remediation): improving output on remediation tests #7955
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
Draft
cx-ricardo-jesus
wants to merge
41
commits into
master
Choose a base branch
from
AST-131335
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+25
−10
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
…ed/payloads/all_payloads.json
…payloads/all_payloads.json
…payloads directory
…samples/sample.tf
…igured_for_organization/payloads/all_payloads.json
…igured_for_organization/payloads directory
…automated_using_release_channels/payloads/all_payloads.json
…automated_using_release_channels/payloads directory
…have_alpha_features_enabled/payloads/all_payloads.json
…older_google_projects/payloads/test_payload.json
…older_google_projects/payloads directory
…figuration_changes/payloads/all_payloads.json
…figuration_changes/payloads directory
…le_changes/test/test.tf
…le_changes/payloads directory
…wnership_assignment_and_changes/payloads/positive1_payload.json
…wnership_assignment_and_changes/payloads directory
…egrity_monitoring_enabled/payloads/all_payloads.json
…egrity_monitoring_enabled/payloads directory
…enabled/test/negative.tf
…enabled/test directory
…enabled directory
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.








Reason for Proposed Changes
Proposed Changes
Summarystruct present inside theutils.gofile, added theRemediatedFiles, which is an array of strings, meant to store the path of the files that were remediated.testRemediationQuery, added a new map, meant to store the connections between the temporary files used to do the remediations and the original files from which those temporary files came. The key is the path to these temporary files, and the value is the path to the original file.tempToOriginalwill be necessary to send the path to the original file through theRemediateFilemethod inside the summary, which now takes one more argument (original_file_name). Within thisRemediateFilemethod, this path is passed to thewriteRemediationfunction to append the original filename to the new fieldRemediatedFilesin theSummarystruct.testRemediationQuery, the test now returns a different message from the original, and now also mentions the files that were remediated.remediation_test.goandremediate.go, because both use the changedRemediateFilemethod that now takes one more argument.remediation_test.go, I passed thefilePathCopyFrom, which is the path of the original file used for the tests.remediate.go, I passed an empty string, because this file handles the remediation command, and in this command, which is meant to apply a remediation to a certain file, the original file path was already sent to theRemediateFilemethod.I submit this contribution under the Apache-2.0 license.