-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update purget test resources to fix the workflow failures
Signed-off-by: ytimocin <[email protected]>
- Loading branch information
Showing
3 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
group1 1000 | ||
group2 2000 | ||
group3 3000 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Create a mock resource_groups.json file | ||
echo '[{"Name": "group1", "creationTime": 1000}, {"Name": "group2", "creationTime": 2000}, {"Name": "group3", "creationTime": 3000}]' > resource_groups.json | ||
|
||
# Set the hours_ago variable to a known value | ||
hours_ago=1500 | ||
|
||
echo "hours_ago: $hours_ago" | ||
|
||
# Run the command | ||
jq -r '.[] | select(.creationTime == null or .creationTime < '$hours_ago') | .Name' resource_groups.json > output.txt | ||
jq -r '.[] | "\(.Name) \(.creationTime // "None")"' resource_groups.json > other_output.txt | ||
|
||
# Check the output | ||
if [[ $(cat output.txt) == "group1" ]]; then | ||
echo "Test passed" | ||
else | ||
echo "Test failed" | ||
fi | ||
|
||
# Clean up | ||
rm resource_groups.json output.txt |