|
@@ -89,7 +89,7 @@ const REPLAY_PROVIDERS = [{
|
|
|
export interface WebScaffold {
|
|
export interface WebScaffold {
|
|
|
/** The active snapshot mode this scaffold booted under. */
|
|
/** The active snapshot mode this scaffold booted under. */
|
|
|
mode: WebSnapshotMode
|
|
mode: WebSnapshotMode
|
|
|
- /** Browser-facing origin (http://127.0.0.1:<bound port>). */
|
|
|
|
|
|
|
+ /** Browser-facing origin for the bound test server. */
|
|
|
baseUrl: string
|
|
baseUrl: string
|
|
|
/** Settled root context (the in-process barrier seam; headless event subscription is its sanctioned use). */
|
|
/** Settled root context (the in-process barrier seam; headless event subscription is its sanctioned use). */
|
|
|
ctx: Context
|
|
ctx: Context
|
|
@@ -166,6 +166,8 @@ export interface LaunchOptions {
|
|
|
}
|
|
}
|
|
|
/** Leave the current welcome notice unacknowledged; ordinary scenarios publish it as complete before browser boot. */
|
|
/** Leave the current welcome notice unacknowledged; ordinary scenarios publish it as complete before browser boot. */
|
|
|
welcomeNoticePending?: boolean
|
|
welcomeNoticePending?: boolean
|
|
|
|
|
+ /** Browse through this trusted non-loopback hostname while the test server stays bound to loopback. */
|
|
|
|
|
+ remoteAuthority?: string
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/** Dispose the booted tree and remove both owned temp roots, reporting every independent cleanup failure. */
|
|
/** Dispose the booted tree and remove both owned temp roots, reporting every independent cleanup failure. */
|
|
@@ -185,6 +187,7 @@ async function cleanupScaffoldWorld(ctx: Context, workspaceCwd: string, persiste
|
|
|
export async function launchWebScaffold(options: LaunchOptions = {}): Promise<WebScaffold> {
|
|
export async function launchWebScaffold(options: LaunchOptions = {}): Promise<WebScaffold> {
|
|
|
requireDist()
|
|
requireDist()
|
|
|
const mode = webSnapshotMode()
|
|
const mode = webSnapshotMode()
|
|
|
|
|
+ const browserHost = options.remoteAuthority ?? '127.0.0.1'
|
|
|
if (mode === 'record') {
|
|
if (mode === 'record') {
|
|
|
// Both owning vitest configs (web unconditionally, snapshot in record
|
|
// Both owning vitest configs (web unconditionally, snapshot in record
|
|
|
// mode) load the repo-root .env before this file runs.
|
|
// mode) load the repo-root .env before this file runs.
|
|
@@ -261,7 +264,13 @@ export async function launchWebScaffold(options: LaunchOptions = {}): Promise<We
|
|
|
// to the production OTLP endpoint (or whatever DSH_TELEMETRY_OTLP_URL
|
|
// to the production OTLP endpoint (or whatever DSH_TELEMETRY_OTLP_URL
|
|
|
// names in the ambient environment).
|
|
// names in the ambient environment).
|
|
|
{ id: 'telemetry-otel', disabled: true },
|
|
{ id: 'telemetry-otel', disabled: true },
|
|
|
- { id: 'webserver', config: { host: '127.0.0.1', port: 0, distIndex: DIST_INDEX } },
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ id: 'webserver',
|
|
|
|
|
+ config: { host: '127.0.0.1', port: 0, distIndex: DIST_INDEX },
|
|
|
|
|
+ },
|
|
|
|
|
+ ...options.remoteAuthority === undefined
|
|
|
|
|
+ ? []
|
|
|
|
|
+ : [{ id: 'connection', config: { trustedHosts: [options.remoteAuthority] } }],
|
|
|
{ id: 'settings', config: { dshHome: harnessHome } },
|
|
{ id: 'settings', config: { dshHome: harnessHome } },
|
|
|
{ id: 'credentials', config: { dshHome: harnessHome } },
|
|
{ id: 'credentials', config: { dshHome: harnessHome } },
|
|
|
// The shipped directory-picker row is the -auto chooser, which resolves
|
|
// The shipped directory-picker row is the -auto chooser, which resolves
|
|
@@ -352,7 +361,7 @@ export async function launchWebScaffold(options: LaunchOptions = {}): Promise<We
|
|
|
return {
|
|
return {
|
|
|
harnessHome,
|
|
harnessHome,
|
|
|
mode,
|
|
mode,
|
|
|
- baseUrl: `http://127.0.0.1:${port}`,
|
|
|
|
|
|
|
+ baseUrl: `http://${browserHost}:${port}`,
|
|
|
ctx,
|
|
ctx,
|
|
|
workspaceCwd,
|
|
workspaceCwd,
|
|
|
persistenceRoot,
|
|
persistenceRoot,
|