Skip to content

Commit

Permalink
fix: t -d
Browse files Browse the repository at this point in the history
  • Loading branch information
arpowers committed Mar 20, 2024
1 parent 27007e7 commit 28828ba
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion @fiction/core/plugin-app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class FictionApp extends FictionPlugin<FictionAppSettings> {
const router = this.fictionRouter.create({ caller: `mountApp:${this.appInstanceId}` })

if (renderRoute)
await this.fictionRouter.replace({ path: renderRoute }, { id: 'mount' })
await this.fictionRouter.replace({ path: renderRoute }, { caller: 'createVueApp' })

await this.utils.runHooks<HookDictionary, 'afterAppSetup'>({
list: this.hooks,
Expand Down
6 changes: 3 additions & 3 deletions @fiction/core/plugin-router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ export class FictionRouter<

public async replace(
location: vueRouter.RouteLocationRaw,
options?: { id?: string },
options?: { caller?: string },
) {
const { id = 'unknown' } = options || {}
const { caller = 'unknown' } = options || {}

if (!this.router.value)
throw new Error(`router not initialized [${this.settings.routerId}]`)
Expand All @@ -319,7 +319,7 @@ export class FictionRouter<
path = location.path

if (!this.fictionEnv?.isRendering)
this.log.info(`setting route ${path} [from ${id}]`)
this.log.info(`setting route ${path} [from ${caller}]`)

await this.router.value.replace(location)
}
Expand Down
11 changes: 11 additions & 0 deletions @fiction/www/test/builtFiles.dist.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ import { describe, expect, it } from 'vitest'
import fs from 'fs-extra'
import { randomBetween, safeDirname } from '@fiction/core'
import { appRunTest } from '@fiction/core/test-utils/buildTest'
import { execaCommandSync } from 'execa'

describe('pre check secrets', () => {
it('has secrets', async () => {
const { stdout } = execaCommandSync('flyctl secrets list -a fiction-sites')

Check failure on line 9 in @fiction/www/test/builtFiles.dist.test.ts

View workflow job for this annotation

GitHub Actions / build and test

@fiction/www/test/builtFiles.dist.test.ts > pre check secrets > has secrets

Error: Command failed with ENOENT: flyctl secrets list -a fiction-sites spawnSync flyctl ENOENT ❯ Object.spawnSync node:child_process:876:24 ❯ execaSync node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js:181:25 ❯ Module.execaCommandSync node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js:276:9 ❯ @fiction/www/test/builtFiles.dist.test.ts:9:24 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'spawnSync flyctl', path: 'flyctl', spawnargs: [ 'secrets', 'list', '-a', 'fiction-sites' ], originalMessage: 'spawnSync flyctl ENOENT', shortMessage: 'Command failed with ENOENT: flyctl secrets list -a fiction-sites\nspawnSync flyctl ENOENT', command: 'flyctl secrets list -a fiction-sites', escapedCommand: 'flyctl secrets list -a fiction-sites', exitCode: undefined, signal: undefined, signalDescription: undefined, stdout: '', stderr: '', cwd: '/home/runner/work/fiction/fiction', failed: true, timedOut: false, isCanceled: false, killed: false }

const secrets = ['FLY_API_TOKEN', 'POSTGRES_URL', 'GH_TOKEN', 'TOKEN_SECRET']
for (const secret of secrets)
expect(stdout).toContain(secret)
})
})

describe('files built', () => {
const dir = safeDirname(import.meta.url, '..')
Expand Down
3 changes: 3 additions & 0 deletions @fiction/www/test/services.live.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { snap } from '@fiction/core/test-utils'
describe('service health checks', () => {
const services = [
'https://www.fiction.cx',
'https://docs.fiction.cx',
'https://theme-minimal.fiction.cx',
'https://andrewpowers.fiction.cx',
'https://www.andrewpowers.com',
]

it('services health endpoint works and logs response time', async () => {
Expand Down

0 comments on commit 28828ba

Please sign in to comment.