🌳
pt0/deployF/testsF/baseTestConfigAI.mts
1// Base runtests configuration for any eptNextjsApp
2// Provides healthgql suite by default. Apps can extend with their own suites.
15// cross-cutting framework suites inherited by every app's runtests config
16export const frameworkSuiteConfigs: SuiteConfig[] = [dockImgCacheSuiteConfig, deployverifySuiteConfig]
18const baseSuiteConfigs: SuiteConfig[] = [
19 ...frameworkSuiteConfigs,
20 buildConfigSuiteConfig,
21 { name: 'clitests', runner: runCliTestsSuite, deps: [] },
22 { name: 'healthgql', runner: runHealthgqlSuite, deps: [] },
23 { name: 'pages', runner: runPagesSuite, deps: ['server'], timeoutMs: 2 * 60 * 1000 },
24 publicipSuiteConfig,
27const baseAllSuites = baseSuiteConfigs.map(s => s.name)
29// Base config - apps can extend this
30export const getBaseTestConfig = async (): Promise<RunTestsCoreConfig> => {
31 const localAppCfg = getAppCfg()
32 return {
33 allSuites: baseAllSuites,
34 localAppCfg,
35 suiteConfigs: baseSuiteConfigs,
36 }
39// Base runtests action - can be used directly or overridden by apps
40export const baseRuntests = async () => {
41 const runtestsCli = mkRuntestsCli(baseAllSuites)
42 const cli = parseCli(runtestsCli)
44 if (cli.history) {
45 const ep = getAppCfg()?.importMetaUrl
46 printTestHistory({ ep, suites: cli.suite })
47 return
48 }
50 const config = await getBaseTestConfig()
51 const opts = optsFromCli(cli, baseAllSuites)
52 const result = await runTestsCore({ config, opts })
53 if (!result.allPassed) process.exit(1)
56baseRuntests.cliSchema = mkRuntestsCli(baseAllSuites)
58// Base testdeploy action - uses healthgql suite
59export const baseTestdeploy = mkTestdeploy({ getTestConfig: getBaseTestConfig })