CustomTemplateTests.cs (19)
62await auto.RunCommandAsync("! command -v dotnet", counter);
66await auto.RunCommandAsync("aspire template source add git-example --repository https://example.test/templates --ref main --path templates --yes --nologo", counter);
67await auto.RunCommandAsync("cp \"$HOME/.aspire/aspire.config.json\" before.json", counter);
68await auto.RunCommandAsync(
71await auto.RunCommandAsync("cmp before.json \"$HOME/.aspire/aspire.config.json\"", counter);
98await auto.RunCommandAsync("cmp before.json \"$HOME/.aspire/aspire.config.json\"", counter);
103await auto.RunCommandAsync("aspire template source list --format json > sources.json", counter);
110await auto.RunCommandAsync("aspire template source list > sources.txt", counter);
114await auto.RunCommandAsync("cp \"$HOME/.aspire/aspire.config.json\" before.json", counter);
115await auto.RunCommandAsync($"aspire template source add COMPANY --repository https://example.test/replacement --yes --nologo; test $? -eq {CliExitCodes.InvalidCommand}", counter);
116await auto.RunCommandAsync("cmp before.json \"$HOME/.aspire/aspire.config.json\"", counter);
117await auto.RunCommandAsync($"aspire config set templateSources.company.path ../escape --global --nologo; test $? -eq {CliExitCodes.InvalidCommand}", counter);
118await auto.RunCommandAsync("cmp before.json \"$HOME/.aspire/aspire.config.json\"", counter);
119await auto.RunCommandAsync("aspire template source remove git-example --nologo", counter);
125await auto.RunCommandAsync(
183await auto.RunCommandAsync("! command -v dotnet", counter);
186await auto.RunCommandAsync("aspire template source remove COMPANY --nologo", counter);
187await auto.RunCommandAsync("aspire template source list --format json > empty-sources.json", counter);
189await auto.RunCommandAsync($"aspire template source remove company --nologo; test $? -eq {CliExitCodes.ConfigNotFound}", counter);
EmptyAppHostTemplateTests.cs (29)
62await auto.RunCommandAsync("cd DestroySentinel", counter);
74await auto.RunCommandAsync(
88await auto.RunCommandAsync(
111await auto.RunCommandAsync("mkdir source-feed && cp \"$HOME\"/.aspire/hives/*/packages/Aspire.ProjectTemplates.*.nupkg source-feed/", counter);
112await auto.RunCommandAsync("aspire --version > /tmp/aspire-source-version", counter);
116await auto.RunCommandAsync("aspire config set features.updateNotificationsEnabled false -g", counter);
117await auto.RunCommandAsync("aspire config set features.showAllTemplates true -g", counter);
118await auto.RunCommandAsync(
125await auto.RunCommandAsync("dotnet nuget disable source nuget.org", counter);
126await auto.RunCommandAsync("dotnet nuget add source \"$PWD/source-feed\" --name source-override-e2e", counter);
130await auto.RunCommandAsync("rm -rf \"$HOME/.aspire/logs\" && mkdir -p \"$HOME/.aspire/logs\"", counter);
132await auto.RunCommandAsync(
138await auto.RunCommandAsync("test -f SourceOverrideServiceDefaults/SourceOverrideServiceDefaults.csproj", counter);
153await auto.RunCommandAsync(
187await auto.RunCommandAsync(
200await auto.RunCommandAsync(
204await auto.RunCommandAsync("aspire config set features.updateNotificationsEnabled false -g", counter);
205await auto.RunCommandAsync("aspire config set features.showAllTemplates true -g", counter);
207await auto.RunCommandAsync("rm -rf \"$HOME/.aspire/logs\" && mkdir -p \"$HOME/.aspire/logs\"", counter);
209await auto.RunCommandAsync(
215await auto.RunCommandAsync("test -f AmbientServiceDefaults/AmbientServiceDefaults.csproj", counter);
216await auto.RunCommandAsync(
246await auto.RunCommandAsync(
250await auto.RunCommandAsync("aspire config set features.updateNotificationsEnabled false -g", counter);
251await auto.RunCommandAsync("aspire config set features.showAllTemplates true -g", counter);
253await auto.RunCommandAsync("rm -rf \"$HOME/.aspire/logs\" && mkdir -p \"$HOME/.aspire/logs\"", counter);
255await auto.RunCommandAsync(
261await auto.RunCommandAsync("test -f DailyServiceDefaults/DailyServiceDefaults.csproj", counter);
262await auto.RunCommandAsync(
GoCodegenValidationTests.cs (8)
62await auto.RunCommandAsync(
92await auto.RunCommandAsync("aspire restore --non-interactive", counter, TimeSpan.FromMinutes(3));
112await auto.RunCommandAsync("mkdir -p ~/sdk-baseline && cp .aspire/modules/aspire.go .aspire/modules/.codegen-hash ~/sdk-baseline/", counter);
114await auto.RunCommandAsync("cp ~/sdk-baseline/aspire.go ~/sdk-baseline/.codegen-hash .aspire/modules/", counter);
121await auto.RunCommandAsync("aspire restore --non-interactive", counter, TimeSpan.FromMinutes(3));
141await auto.RunCommandAsync("go build -buildvcs=false ./... && go vet ./...", counter, TimeSpan.FromMinutes(3));
142await auto.RunCommandAsync("(cd .aspire/modules && go vet ./...)", counter, TimeSpan.FromMinutes(3));
145await auto.RunCommandAsync("(cd api && go build -buildvcs=false ./... && go vet ./...)", counter, TimeSpan.FromMinutes(3));
GoPublishTests.cs (13)
33await auto.RunCommandAsync("aspire restore --non-interactive", counter, TimeSpan.FromMinutes(3));
37await auto.RunCommandAsync("unset ASPIRE_PLAYGROUND", counter);
38await auto.RunCommandAsync("aspire publish -o artifacts --non-interactive", counter, TimeSpan.FromMinutes(5));
40await auto.RunCommandAsync("ls -la artifacts/docker-compose.yaml", counter);
41await auto.RunCommandAsync("grep -F \"api:\" artifacts/docker-compose.yaml", counter);
42await auto.RunCommandAsync("grep -F \"validation-api\" artifacts/docker-compose.yaml", counter);
63await auto.RunCommandAsync("aspire restore --non-interactive", counter, TimeSpan.FromMinutes(3));
67await auto.RunCommandAsync("unset ASPIRE_PLAYGROUND", counter);
68await auto.RunCommandAsync("aspire publish --non-interactive", counter, TimeSpan.FromMinutes(5));
95await auto.RunCommandAsync($"cd {projectName}", counter);
97await auto.RunCommandAsync("aspire restore --non-interactive", counter, TimeSpan.FromMinutes(3));
104await auto.RunCommandAsync("unset ASPIRE_PLAYGROUND", counter);
105await auto.RunCommandAsync("aspire publish -o artifacts --non-interactive", counter, TimeSpan.FromMinutes(5));
GoSecretAppHostTests.cs (7)
49await auto.RunCommandAsync("aspire secret get MyConfig:ApiKey --apphost apphost.go | grep -qx 'test-key-123'", counter, TimeSpan.FromSeconds(30));
50await auto.RunCommandAsync("aspire secret list --apphost apphost.go | grep 'ConnectionStrings:Db' | grep 'Server=localhost' >/dev/null", counter, TimeSpan.FromSeconds(30));
60await auto.RunCommandAsync("aspire secret list --apphost apphost.go --format json > listed-secrets.json", counter, TimeSpan.FromSeconds(30));
75await auto.RunCommandAsync("aspire secret get MyConfig:ApiKey --environment Staging --apphost apphost.go | grep -qx 'staging-go-secret'", counter, TimeSpan.FromSeconds(30));
76await auto.RunCommandAsync("aspire secret get MyConfig:ApiKey --environment Production --apphost apphost.go | grep -qx 'production-go-secret'", counter, TimeSpan.FromSeconds(30));
77await auto.RunCommandAsync("aspire secret list --all --apphost apphost.go | grep 'staging-go-secret' | grep 'Staging' >/dev/null", counter, TimeSpan.FromSeconds(30));
78await auto.RunCommandAsync("aspire secret list --all --apphost apphost.go | grep 'production-go-secret' | grep 'Production' >/dev/null", counter, TimeSpan.FromSeconds(30));
GoStarterReadinessTests.cs (11)
39await auto.RunCommandAsync(
49await auto.RunCommandAsync("cd GoReady", counter);
53await auto.RunCommandAsync("(cd api && go build -mod=readonly -o /tmp/go-ready-api . && go mod tidy -diff)", counter, TimeSpan.FromMinutes(3));
54await auto.RunCommandAsync("npm --prefix frontend ci && npm --prefix frontend run build", counter, TimeSpan.FromMinutes(3));
59await auto.RunCommandAsync("aspire wait app --status up --timeout 120", counter, TimeSpan.FromMinutes(3));
60await auto.RunCommandAsync("aspire wait frontend --status up --timeout 120", counter, TimeSpan.FromMinutes(3));
63await auto.RunCommandAsync("aspire wait cache --status up --timeout 120", counter, TimeSpan.FromMinutes(3));
65await auto.RunCommandAsync("aspire describe frontend --format json > frontend.json", counter);
68await auto.RunCommandAsync(
72await auto.RunCommandAsync(
78await auto.RunCommandAsync(
Helpers\CliE2EAutomatorHelpers.cs (23)
107await auto.RunCommandAsync("umask 000", counter);
110await auto.RunCommandAsync(AspireCliShellCommandHelpers.GetPrepareAspireEnvironmentCommand(), counter);
114await auto.RunCommandAsync(GetSettledNpmReleasesCommand(DateTimeOffset.UtcNow), counter);
119await auto.RunCommandAsync("export DCP_DIAGNOSTICS_LOG_LEVEL=debug DCP_DIAGNOSTICS_LOG_FOLDER=~/.aspire/dcp-logs DCP_PRESERVE_EXECUTABLE_LOGS=1", counter);
126await auto.RunCommandAsync($"cd {AspireCliShellCommandHelpers.QuoteBashArg(containerWorkspace)}", counter);
128await auto.RunCommandAsync($"export ASPIRE_E2E_WORKSPACE={AspireCliShellCommandHelpers.QuoteBashArg(containerWorkspace)}", counter);
132await auto.RunCommandAsync(
154await auto.RunCommandAsync($"printf '127.0.0.1 {blockedHosts}\\n' >> /etc/hosts", counter);
155await auto.RunCommandAsync(
168=> auto.RunCommandAsync("test ! -e /tmp/unexpected-nuget-source-contacted", counter);
197await auto.RunCommandAsync(
205await auto.RunCommandAsync(
217await auto.RunCommandAsync(
226await auto.RunCommandAsync(
526await auto.RunCommandAsync(
539await auto.RunCommandAsync(
668await auto.RunCommandAsync($"export ASPIRE_E2E_WORKSPACE={AspireCliShellCommandHelpers.QuoteBashArg(workspace.WorkspaceRoot.FullName)}", counter);
672await auto.RunCommandAsync(
689await auto.RunCommandAsync(command, counter, TimeSpan.FromSeconds(300));
774await auto.RunCommandAsync(
787await auto.RunCommandAsync("clear", counter);
841await auto.RunCommandAsync(command, counter, TimeSpan.FromSeconds(300));
1045await auto.RunCommandAsync(
Helpers\ConfigSourceTestContext.cs (39)
63await _auto.RunCommandAsync($"{NewCommand} --use-config-source --non-interactive", _counter,
70await _auto.RunCommandAsync($"{NewCommand} --use-config-source false --non-interactive", _counter,
74await _auto.RunCommandAsync("aspire config delete configSource", _counter);
75await _auto.RunCommandAsync("aspire config set docs.llmsTxtUrl https://local.example/llms.txt", _counter);
105await _auto.RunCommandAsync(
114await _auto.RunCommandAsync($"aspire add {id} --version 1.0.0 --non-interactive", _counter,
118await _auto.RunCommandAsync("cat apphost.cs > \"$ASPIRE_E2E_WORKSPACE/actual-apphost.cs\"", _counter);
126await _auto.RunCommandAsync("mkdir SourceApp && cd SourceApp && dotnet new sln --name SourceApp", _counter);
127await _auto.RunCommandAsync(
130await _auto.RunCommandAsync(
143await _auto.RunCommandAsync("mkdir AppHost && mv apphost.cs apphost.run.json AppHost", _counter);
144await _auto.RunCommandAsync("aspire config set appHost.path AppHost/apphost.cs", _counter);
199await _auto.RunCommandAsync(
231await _auto.RunCommandAsync(
285await _auto.RunCommandAsync(
287await _auto.RunCommandAsync(command, _counter);
290await _auto.RunCommandAsync(
315await _auto.RunCommandAsync($"cd \"{directory}\"", _counter);
320=> _auto.RunCommandAsync("test ! -f aspire.config.json", _counter);
327await _auto.RunCommandAsync("dotnet run \"$ASPIRE_E2E_WORKSPACE/check-source.cs\" -- expire", _counter);
328await _auto.RunCommandAsync(
330await _auto.RunCommandAsync("dotnet run \"$ASPIRE_E2E_WORKSPACE/check-source.cs\" -- wait \"$source_run_pid\"", _counter,
332await _auto.RunCommandAsync("kill -INT \"$source_run_pid\"; timeout 120 tail --pid=\"$source_run_pid\" -f /dev/null; wait \"$source_run_pid\"", _counter,
334await _auto.RunCommandAsync("cat \"$ASPIRE_E2E_WORKSPACE/run.log\"", _counter);
340=> _auto.RunCommandAsync(
346await _auto.RunCommandAsync(
397await _auto.RunCommandAsync("aspire config set features.updateNotificationsEnabled false -g", _counter);
399await _auto.RunCommandAsync("git config --global --add safe.directory \"$ASPIRE_E2E_WORKSPACE/configuration source\"", _counter);
400await _auto.RunCommandAsync($"git -C 'configuration source' init --initial-branch=main --object-format={objectFormat}", _counter);
401await _auto.RunCommandAsync("git -C 'configuration source' config user.name 'Aspire E2E'", _counter);
402await _auto.RunCommandAsync("git -C 'configuration source' config user.email aspire-e2e@example.com", _counter);
404await _auto.RunCommandAsync(
411await _auto.RunCommandAsync("cd SourceApp", _counter);
412await _auto.RunCommandAsync("aspire config set docs.custom keep", _counter);
416=> _auto.RunCommandAsync("test ! -d \"$HOME/.aspire/configsources\"", _counter);
422await _auto.RunCommandAsync(
431=> _auto.RunCommandAsync(
471await _auto.RunCommandAsync(
475await _auto.RunCommandAsync(
IntegrationHostLifetimeTests.cs (30)
62await auto.RunCommandAsync("aspire init --language typescript --non-interactive", counter, TimeSpan.FromMinutes(3));
67await auto.RunCommandAsync(
70await auto.RunCommandAsync("node process-control.mjs install-ready", counter, TimeSpan.FromMinutes(3));
71await auto.RunCommandAsync("node process-control.mjs install-kill", counter);
72await auto.RunCommandAsync("node process-control.mjs install-stopped", counter, TimeSpan.FromSeconds(75));
73await auto.RunCommandAsync("grep 'INSTALL_LIFETIME' install-session.log", counter);
75await auto.RunCommandAsync("aspire restore --non-interactive", counter, TimeSpan.FromMinutes(3));
81await auto.RunCommandAsync(
84await auto.RunCommandAsync("node process-control.mjs ready", counter, TimeSpan.FromMinutes(3));
85await auto.RunCommandAsync("aspire resource probe probe > probe-before.log 2>&1", counter);
86await auto.RunCommandAsync("node process-control.mjs probe && node process-control.mjs snapshot", counter);
90await auto.RunCommandAsync("node process-control.mjs block", counter, TimeSpan.FromSeconds(75));
95await auto.RunCommandAsync(
106await auto.RunCommandAsync(
109await auto.RunCommandAsync("node process-control.mjs stall-diagnostics", counter);
113await auto.RunCommandAsync("node process-control.mjs stopped", counter, TimeSpan.FromSeconds(75));
118await auto.RunCommandAsync(
121await auto.RunCommandAsync("grep -iE 'exited|failed|disconnect' run.log", counter);
125await auto.RunCommandAsync("node process-control.mjs exhausted", counter);
129await auto.RunCommandAsync("node process-control.mjs callbacks", counter);
131await auto.RunCommandAsync("aspire start --non-interactive > restart.log 2>&1", counter, TimeSpan.FromMinutes(3));
135await auto.RunCommandAsync("node process-control.mjs recovered", counter, TimeSpan.FromSeconds(75));
138await auto.RunCommandAsync("aspire resource probe probe > probe-after.log 2>&1", counter);
139await auto.RunCommandAsync("node process-control.mjs probe && cat probe-after.log", counter);
140await auto.RunCommandAsync("aspire describe probe --format json > recovered-resource.json", counter);
141await auto.RunCommandAsync("node process-control.mjs describe", counter);
142await auto.RunCommandAsync("aspire stop --non-interactive > stop.log 2>&1", counter, TimeSpan.FromMinutes(1));
143await auto.RunCommandAsync("node process-control.mjs clean", counter, TimeSpan.FromSeconds(75));
146await auto.RunCommandAsync("mkdir -p exported-logs && install -m 0644 session.log exported-logs/session.log", counter);
149await auto.RunCommandAsync("install -m 0644 install-session.log exported-logs/install-session.log", counter);
StartStopTests.cs (22)
99await auto.RunCommandAsync($"cd {AspireCliShellCommandHelpers.QuoteBashArg(projectName)}", counter);
142await auto.RunCommandAsync($"ln -s {projectName} {projectLinkName}", counter);
148await auto.RunCommandAsync(
152await auto.RunCommandAsync(
235await auto.RunCommandAsync($"cd {AspireCliShellCommandHelpers.QuoteBashArg(projectName)}", counter);
236await auto.RunCommandAsync(
248await auto.RunCommandAsync(
251await auto.RunCommandAsync($"cd {AspireCliShellCommandHelpers.QuoteBashArg(linkedCheckout)}", counter);
252await auto.RunCommandAsync(
255await auto.RunCommandAsync(
260await auto.RunCommandAsync(
278await auto.RunCommandAsync($"cd {AspireCliShellCommandHelpers.QuoteBashArg(primaryCheckout)}", counter);
280await auto.RunCommandAsync(
290await auto.RunCommandAsync($"cd {AspireCliShellCommandHelpers.QuoteBashArg(linkedCheckout)}", counter);
293await auto.RunCommandAsync(
305await auto.RunCommandAsync(
365await auto.RunCommandAsync($"cd {AspireCliShellCommandHelpers.QuoteBashArg(projectName)}", counter);
408await auto.RunCommandAsync("export ASPIRE_E2E_LAUNCHER_PGID=$(ps -o pgid= -p $$ | tr -d ' ') ASPIRE_E2E_LAUNCHER_SID=$(ps -o sid= -p $$ | tr -d ' ')", counter);
409await auto.RunCommandAsync("aspire start --format json > /tmp/aspire-start.json", counter, TimeSpan.FromMinutes(2));
552await auto.RunCommandAsync(
561await auto.RunCommandAsync(
582await auto.RunCommandAsync(
TypeScriptPublishTests.cs (7)
41await auto.RunCommandAsync("aspire init --language typescript --non-interactive", counter, TimeSpan.FromMinutes(2));
47await auto.RunCommandAsync("aspire add Aspire.Hosting.Kubernetes", counter, TimeSpan.FromMinutes(2));
48await auto.RunCommandAsync("aspire restore", counter, TimeSpan.FromMinutes(3));
118await auto.RunCommandAsync("unset ASPIRE_PLAYGROUND", counter);
119await auto.RunCommandAsync("export Parameters__storageclass=fast Parameters__capacity=5Gi Parameters__backuptier=daily", counter);
120await auto.RunCommandAsync("aspire publish -o artifacts --non-interactive", counter, TimeSpan.FromMinutes(5));
137await auto.RunCommandAsync("! aspire publish -o failed-artifacts --non-interactive > callback-failure.log 2>&1",
UpdateChannelNuGetConfigOrderingTests.cs (14)
95await auto.RunCommandAsync("export NUGET_PACKAGES=\"$ASPIRE_E2E_WORKSPACE/.nuget-packages\"", counter);
132await auto.RunCommandAsync(
135await auto.RunCommandAsync("dotnet restore AppHost.csproj --force --no-http-cache", counter, TimeSpan.FromMinutes(3));
138await auto.RunCommandAsync("dotnet nuget remove source seed-local --configfile nuget.config", counter);
146await auto.RunCommandAsync(dryRunCommand + " --non-interactive", counter, TimeSpan.FromMinutes(3));
153await auto.RunCommandAsync(dryRunCommand + " --yes --non-interactive; printf '%s' \"$?\" > dry-run-exit.txt",
180await auto.RunCommandAsync("dotnet restore AppHost.csproj --locked-mode --force --no-http-cache", counter, TimeSpan.FromMinutes(3));
187await auto.RunCommandAsync(
202await auto.RunCommandAsync(
204await auto.RunCommandAsync(
422await auto.RunCommandAsync("aspire config set features.updateNotificationsEnabled false -g", counter);
427await auto.RunCommandAsync(
476await auto.RunCommandAsync($"cd {projectName}", counter);
532await auto.RunCommandAsync("dotnet restore apphost.cs --force", counter, timeout: TimeSpan.FromMinutes(3));