Skip to content

Commit f0b2074

Browse files
committed
Add verification wrapper script; align CLI test with RUSTAPI_CONFIG_PATH
1 parent ed467da commit f0b2074

3 files changed

Lines changed: 17 additions & 12 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
.env.*
77
!.env.example
88
/scripts
9+
!scripts/run-verification-plan.ps1
10+
/terminals
911
# /benches
1012
/.kiro
1113

crates/cargo-rustapi/tests/cli_tests.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -509,19 +509,14 @@ mod deploy_command {
509509
(cloud_url, handle)
510510
}
511511

512-
fn write_cloud_config(home: &std::path::Path, cloud_url: &str, token: &str) {
513-
let dir = home.join(".rustapi");
514-
fs::create_dir_all(&dir).expect("config dir");
512+
fn write_cloud_config_file(path: &std::path::Path, cloud_url: &str, token: &str) {
515513
let config = serde_json::json!({
516514
"token": token,
517515
"cloud_url": cloud_url,
518516
"user": { "login": "cli-test", "tier": "hobby" }
519517
});
520-
fs::write(
521-
dir.join("config.json"),
522-
serde_json::to_string_pretty(&config).expect("json"),
523-
)
524-
.expect("write config");
518+
fs::write(path, serde_json::to_string_pretty(&config).expect("json"))
519+
.expect("write config");
525520
}
526521

527522
#[test]
@@ -546,12 +541,12 @@ mod deploy_command {
546541
fn test_deploy_status_fetches_live_response_from_cloud() {
547542
let deploy_id = "cli-mock-deploy-1";
548543
let (cloud_url, server) = spawn_mock_deploy_status_server(deploy_id);
549-
let home = tempdir().expect("cli home");
550-
write_cloud_config(home.path(), &cloud_url, "mock-jwt-token");
544+
let dir = tempdir().expect("config dir");
545+
let config_path = dir.path().join("cloud-config.json");
546+
write_cloud_config_file(&config_path, &cloud_url, "mock-jwt-token");
551547

552548
cargo_rustapi()
553-
.env("USERPROFILE", home.path())
554-
.env("HOME", home.path())
549+
.env("RUSTAPI_CONFIG_PATH", &config_path)
555550
.args(["deploy", "status", deploy_id])
556551
.assert()
557552
.success()

scripts/run-verification-plan.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Wrapper: sole verification entry point from the RustAPI workspace.
2+
param(
3+
[string]$Scratch = "C:\Users\tunay\AppData\Local\Temp\grok-goal-21752d8f00a1\implementer"
4+
)
5+
6+
$cloudScript = Join-Path (Split-Path $PSScriptRoot -Parent) "..\RustAPI-Cloud\scripts\run-verification-plan.ps1"
7+
& $cloudScript -Scratch $Scratch
8+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

0 commit comments

Comments
 (0)