-
-
Notifications
You must be signed in to change notification settings - Fork 28
Added timing to the provision command. #1850
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -78,6 +78,8 @@ yesno() { [ "${1}" = "1" ] && echo "Yes" || echo "No"; } | |||||
|
|
||||||
| info "Started site provisioning." | ||||||
|
|
||||||
| start_time=$(date +%s) | ||||||
|
|
||||||
|
Comment on lines
+81
to
+82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Leverage built-in Storing - start_time=$(date +%s)
+trap 'duration=$SECONDS; info "Finished site provisioning ($((duration / 60))m $((duration % 60))s)."' EXITBenefits: 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| if [ "${VORTEX_PROVISION_SKIP}" = "1" ]; then | ||||||
| pass "Skipped site provisioning as VORTEX_PROVISION_SKIP is set to 1." | ||||||
| info "Finished site provisioning." | ||||||
|
|
@@ -240,7 +242,8 @@ echo | |||||
| if [ "${VORTEX_PROVISION_POST_OPERATIONS_SKIP}" = "1" ]; then | ||||||
| info "Skipped running of post-provision operations as VORTEX_PROVISION_POST_OPERATIONS_SKIP is set to 1." | ||||||
| echo | ||||||
| info "Finished site provisioning." | ||||||
| duration=$(($(date +%s) - start_time)) | ||||||
| info "Finished site provisioning ($((duration / 60))m $((duration % 60))s)." | ||||||
| exit 0 | ||||||
|
Comment on lines
+245
to
247
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Three copies of the same duration maths – extract once The identical block duration=$(($(date +%s) - start_time))
info "Finished site provisioning ($((duration / 60))m $((duration % 60))s)."appears twice (lines 245-247 & 330-331) and would need a third copy for the early-return path. Duplicate snippets are error-prone and already violate DRY. If you don’t adopt the print_duration() {
local duration=$(( $(date +%s) - start_time ))
info "Finished site provisioning ($((duration/60))m $((duration%60))s)."
}and call Also applies to: 330-331 🤖 Prompt for AI Agents |
||||||
| fi | ||||||
|
|
||||||
|
|
@@ -324,4 +327,5 @@ if [ "${VORTEX_PROVISION_USE_MAINTENANCE_MODE}" = "1" ]; then | |||||
| echo | ||||||
| fi | ||||||
|
|
||||||
| info "Finished site provisioning." | ||||||
| duration=$(($(date +%s) - start_time)) | ||||||
| info "Finished site provisioning ($((duration / 60))m $((duration % 60))s)." | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Test expectations no longer cover the new “(Xm Ys)” suffix
The assertions were trimmed to
"Finished site provisioning"(without the period) but the production script now appends timing info like(0m 03s)..While substring matching will still pass, we lose coverage that the timing text is present and correctly formatted.
Consider tightening the check, e.g.:
assert_output_contains_regex 'Finished site provisioning \([0-9]\+m [0-9]\+s\)\.'(or equivalent helper) so the tests fail if the timing output is accidentally removed in the future.
Also applies to: 298-299, 438-439, 583-584, 723-724, 857-858, 998-999, 1117-1118
🤖 Prompt for AI Agents