Add hosted staging smoke entrypoint

This commit is contained in:
rcourtman 2026-04-15 12:17:57 +01:00
parent 9352533d70
commit f94601e26f
6 changed files with 167 additions and 16 deletions

View file

@ -11,8 +11,6 @@ import {
} from './hosted-tenant-runtime.mjs';
import { createHostedRelayMobileToken } from './hosted-mobile-token-runtime.mjs';
const DEFAULT_CLOUD_HOST = 'root@pulse-cloud';
const DEFAULT_CONTROL_PLANE_URL = 'https://cloud.pulserelay.pro';
const DEFAULT_POLL_INTERVAL_MS = 500;
const DEFAULT_POLL_TIMEOUT_MS = 15_000;
const REPO_ROOT = path.resolve(path.dirname(new URL(import.meta.url).pathname), '..', '..', '..');
@ -24,15 +22,15 @@ function usage(message) {
}
console.error(
'usage: node ./tests/integration/scripts/bootstrap-hosted-mobile-onboarding.mjs --tenant-id <id> [--email <email>] [--cloud-host <user@host>] [--control-plane-url <url>] [--poll-timeout-ms <ms>] [--poll-interval-ms <ms>]',
'usage: node ./tests/integration/scripts/bootstrap-hosted-mobile-onboarding.mjs --tenant-id <id> --cloud-host <user@host> --control-plane-url <url> [--email <email>] [--poll-timeout-ms <ms>] [--poll-interval-ms <ms>]',
);
process.exit(1);
}
function parseArgs(argv) {
const parsed = {
cloudHost: DEFAULT_CLOUD_HOST,
controlPlaneUrl: DEFAULT_CONTROL_PLANE_URL,
cloudHost: '',
controlPlaneUrl: '',
email: '',
pollIntervalMs: DEFAULT_POLL_INTERVAL_MS,
pollTimeoutMs: DEFAULT_POLL_TIMEOUT_MS,
@ -82,6 +80,9 @@ function parseArgs(argv) {
if (!parsed.tenantId) {
usage('--tenant-id is required');
}
if (!parsed.cloudHost) {
usage('--cloud-host is required');
}
if (!parsed.controlPlaneUrl) {
usage('--control-plane-url is required');
}

View file

@ -2,9 +2,13 @@ import { expect, test } from '@playwright/test';
import { completeStripeSandboxCheckout } from './stripe-sandbox';
import { preferredPlaywrightRouteBaseURL } from './runtime-defaults';
function explicitCloudBaseURL(): string {
return String(process.env.PULSE_CLOUD_BASE_URL || '').trim();
}
function cloudBaseURL(): string {
return preferredPlaywrightRouteBaseURL(process.env, [
process.env.PULSE_CLOUD_BASE_URL,
explicitCloudBaseURL(),
]);
}
@ -23,6 +27,10 @@ test.describe.serial('Cloud hosting public signup flows', () => {
test('completes hosted cloud signup checkout through Stripe sandbox', async ({ page }, testInfo) => {
test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop-only cloud hosting workflow coverage');
test.skip(
explicitCloudBaseURL() === '',
'Set PULSE_CLOUD_BASE_URL to run hosted cloud signup coverage.',
);
const baseURL = cloudBaseURL();
const identity = signupIdentity();
@ -66,6 +74,10 @@ test.describe.serial('Cloud hosting public signup flows', () => {
test('accepts magic-link request via real public endpoint', async ({ page }, testInfo) => {
test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop-only cloud hosting workflow coverage');
test.skip(
explicitCloudBaseURL() === '',
'Set PULSE_CLOUD_BASE_URL to run hosted cloud signup coverage.',
);
const baseURL = cloudBaseURL();
const email = createdEmail || signupIdentity().email;

View file

@ -29,9 +29,13 @@ type StripeSubscriptionResponse = {
metadata?: Record<string, string>;
};
function explicitCloudBaseURL(): string {
return String(process.env.PULSE_CLOUD_BASE_URL || '').trim();
}
function cloudBaseURL(): string {
return preferredPlaywrightRouteBaseURL(process.env, [
process.env.PULSE_CLOUD_BASE_URL,
explicitCloudBaseURL(),
]);
}
@ -93,6 +97,10 @@ test.describe.serial('Cloud billing lifecycle (post-checkout)', () => {
testInfo.project.name.startsWith('mobile-'),
'Desktop-only cloud billing lifecycle coverage',
);
test.skip(
explicitCloudBaseURL() === '',
'Set PULSE_CLOUD_BASE_URL to run hosted cloud billing lifecycle coverage.',
);
const requiredVars = [
'PULSE_CP_ADMIN_KEY',