Add CreatedBefore and CreatedAfter Filters for AdminRunsListOptions
#916
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.
Description
Adds
CreatedAfter
andCreatedBefore
Date Time filters forAdminRunsListOptions
.Testing plan
Added Unit tests, but otherwise made a test scripts to test things out as well.
Link to the gist containing the scripts and it's output: https://gist.github.com/Maed223/9e7c5b9a110c0c83a16d7b0eeb389c6b
External links
Output from tests
From added unit tests pointing to local TFE instance.
➜ go-tfe git:(filtering-run-by-date) ✗ go test -run ^TestAdminRuns_ListFilterByDates$ PASS ok github.com/hashicorp/go-tfe 9.649s
Could envision the possibility that these tests are flakey on CI with assertions based on timestamps. I didn't see it in running against my local instance, but I've leave it up to reviewer if there is a better way to go about testing this behavior, or to just omit adding tests for it.