Skip to content

[-] Cleanup smoke test#369

Open
ajalon1 wants to merge 3 commits intodatarobot-oss:mainfrom
ajalon1:aj/cleanup-smoke-test
Open

[-] Cleanup smoke test#369
ajalon1 wants to merge 3 commits intodatarobot-oss:mainfrom
ajalon1:aj/cleanup-smoke-test

Conversation

@ajalon1
Copy link
Contributor

@ajalon1 ajalon1 commented Feb 13, 2026

RATIONALE

Just doing some minor tweaks to the CLI smoke tests since I'm in this part of the repo anyway.

CHANGES

TODO

Cleanup changes were not necessary!

On the Ubuntu and MacOS side

  • Add convenience logging functions info/success/error. error will exit automatically.
  • typo ("expected expected")
  • cleanup the temporary drconfig.yaml file and completion file

Windows side

  • try-finally to cleanup the temporary drconfig.yaml file and completion file
  • actually validate some output from dr help, rather than check the exit code
  • actually validate output from dr self version
  • reorganized tests a bit

PR Automation

Comment-Commands: Trigger CI by commenting on the PR:

  • /trigger-smoke-test or /trigger-test-smoke - Run smoke tests
  • /trigger-install-test or /trigger-test-install - Run installation tests

Labels: Apply labels to trigger workflows:

  • run-smoke-tests or go - Run smoke tests on demand (only works for non-forked PRs)

Important

For Forked PRs: If you're an external contributor, the run-smoke-tests label won't work. Only maintainers can trigger smoke tests on forked PRs by applying the approved-for-smoke-tests label after security review. Please comment requesting maintainer review if you need smoke tests to run.

use trap to cleanup the drconfig.yaml file; create separate info/error/success convenience logging fns
use LASTEXITCODE for a stronger validation of dr auth check; try-finally to cleanup drconfig.yaml and powershell completion; stronger validation of dr help; simplified validation of dr self version;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes here are whitespace from the try-finally. Don't know a better way to do this like trap cleanup in bash.

Comment on lines -92 to -97
Write-Delimiter "Execute dr help run"
dr help run
if ($LASTEXITCODE -ne 0) {
Write-ErrorMsg "dr help run command failed"
}
Write-End
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL this could be more useful.

Comment on lines -106 to -121
# Test completion generation
Write-Delimiter "Testing completion generation"
$completion_file = "completion_powershell.ps1"
dr self completion powershell > $completion_file
if ($LASTEXITCODE -ne 0) {
Write-ErrorMsg "dr self completion powershell command failed"
}
Write-Delimiter "Execute dr self version"
$version_json = dr self version --format=json
if ($LASTEXITCODE -ne 0) {
Write-ErrorMsg "dr self version command failed"
}

# Check if completion file contains expected content
if (Test-Path $completion_file) {
$completion_content = Get-Content $completion_file -Raw
if ($completion_content -match "Register-ArgumentCompleter") {
Write-SuccessMsg "Assertion passed: We have expected $completion_file file with Register-ArgumentCompleter."
Remove-Item $completion_file -Force
# Simplified version key check for PowerShell
if ($version_json -match '"version":') {
Write-SuccessMsg "Version command returned expected 'version' key in json output."
} else {
Write-ErrorMsg "Assertion failed: We don't have expected $completion_file file with expected function."
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just got moved down a bit

Comment on lines +195 to 203
} finally {
Write-InfoMsg "Cleaning up..."
if (Test-Path $testing_dr_cli_config_dir) {
Remove-Item -Recurse -Force $testing_dr_cli_config_dir
}
if (Test-Path "completion_powershell.ps1") {
Remove-Item -Force "completion_powershell.ps1"
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup!

Comment on lines +5 to +18
# Helper functions
error() {
echo "❌ $1"
exit 1
}

success() {
echo "✅ $1"
}

info() {
echo "ℹ️ $1"
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could be persuaded to use different names for these lol

@github-actions
Copy link
Contributor

🔐 Smoke tests approved by maintainer

⏳ Running security scans before executing smoke tests with secrets...

A maintainer has approved this fork PR to run smoke tests. Security scans will run first.

@github-actions
Copy link
Contributor

Some smoke tests failed. (Fork PR)

✅ Security Scan: success
❌ Linux: failure
❌ Windows: failure

View run details

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.

1 participant

Comments