Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bare flag from helper.stage(), etc in tests #506

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/01-smoke.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test('smoke', async function ({ ok, is, alike, plan, comment, teardown, timeout
const id = Math.floor(Math.random() * 10000)

comment('staging')
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(staging))
const staged = await Helper.pick(staging, { tag: 'final' })
ok(staged.success, 'stage succeeded')
Expand Down Expand Up @@ -59,7 +59,7 @@ test('smoke', async function ({ ok, is, alike, plan, comment, teardown, timeout
const id = Math.floor(Math.random() * 10000)

comment('staging')
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(staging))
const staged = await Helper.pick(staging, { tag: 'final' })
ok(staged.success, 'stage succeeded')
Expand Down Expand Up @@ -141,7 +141,7 @@ test('app with assets', async function ({ ok, is, plan, comment, teardown, timeo
const id = Math.floor(Math.random() * 10000)

comment('staging')
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(staging))
const staged = await Helper.pick(staging, { tag: 'final' })
ok(staged.success, 'stage succeeded')
Expand Down Expand Up @@ -179,7 +179,7 @@ test('app with assets in sub dep', async function ({ ok, is, plan, comment, tear
const id = Math.floor(Math.random() * 10000)

comment('staging')
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(staging))
const staged = await Helper.pick(staging, { tag: 'final' })
ok(staged.success, 'stage succeeded')
Expand Down
6 changes: 3 additions & 3 deletions test/02-teardown.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test('teardown on pipe end', { skip: isWindows }, async function ({ ok, is, plan
const id = Math.floor(Math.random() * 10000)

comment('staging')
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(staging))
const staged = await Helper.pick(staging, { tag: 'final' })
ok(staged.success, 'stage succeeded')
Expand Down Expand Up @@ -58,7 +58,7 @@ test('teardown on os kill', { skip: isWindows }, async function ({ ok, is, plan,
const id = Math.floor(Math.random() * 10000)

comment('staging')
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(staging))
const staged = await Helper.pick(staging, { tag: 'final' })
ok(staged.success, 'stage succeeded')
Expand Down Expand Up @@ -97,7 +97,7 @@ test('teardown on os kill with exit code', { skip: isWindows }, async function (
const id = Math.floor(Math.random() * 10000)

comment('staging')
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(staging))
const staged = await Helper.pick(staging, { tag: 'final' })
ok(staged.success, 'stage succeeded')
Expand Down
6 changes: 3 additions & 3 deletions test/03-worker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test('worker should run directly in a terminal app', async function ({ is, plan,

const testId = Math.floor(Math.random() * 100000)
comment('Staging worker-runner...')
const staging = helper.stage({ channel: `test-${testId}`, name: `test-${testId}`, key: null, dir: workerRunner, cmdArgs: [], dryRun: false, bare: true, ignore: [] })
const staging = helper.stage({ channel: `test-${testId}`, name: `test-${testId}`, key: null, dir: workerRunner, cmdArgs: [], dryRun: false, ignore: [] })
teardown(() => Helper.teardownStream(staging))
const until = await Helper.pick(staging, [{ tag: 'staging' }, { tag: 'final' }])
const { link } = await until.staging
Expand All @@ -91,14 +91,14 @@ test('worker should run as a link in a terminal app', async function ({ is, plan

const testId = Math.floor(Math.random() * 100000)
comment('Staging worker-runner...')
const staging1 = helper.stage({ channel: `test-${testId}`, name: `test-${testId}`, key: null, dir: workerRunner, cmdArgs: [], dryRun: false, bare: true, ignore: [] })
const staging1 = helper.stage({ channel: `test-${testId}`, name: `test-${testId}`, key: null, dir: workerRunner, cmdArgs: [], dryRun: false, ignore: [] })
teardown(() => Helper.teardownStream(staging1))
const until1 = await Helper.pick(staging1, [{ tag: 'staging' }, { tag: 'final' }])
const { link: runnerLink } = await until1.staging
await until1.final

comment('Staging worker...')
const staging2 = helper.stage({ channel: `test-worker-${testId}`, name: `test-worker-${testId}`, key: null, dir: helloWorld, cmdArgs: [], dryRun: false, bare: true, ignore: [] })
const staging2 = helper.stage({ channel: `test-worker-${testId}`, name: `test-worker-${testId}`, key: null, dir: helloWorld, cmdArgs: [], dryRun: false, ignore: [] })
teardown(() => Helper.teardownStream(staging2))
const until2 = await Helper.pick(staging2, [{ tag: 'staging' }, { tag: 'final' }])
const { link: workerLink } = await until2.staging
Expand Down
4 changes: 2 additions & 2 deletions test/04-encrypted.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test('stage, seed and run encrypted app', async function ({ ok, is, plan, commen
const password = hypercoreid.encode(crypto.randomBytes(32))

comment('staging throws without encryption key')
const stagingA = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const stagingA = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(stagingA))
const error = await Helper.pick(stagingA, { tag: 'error' })
is(error.code, 'ERR_PERMISSION_REQUIRED')
Expand All @@ -39,7 +39,7 @@ test('stage, seed and run encrypted app', async function ({ ok, is, plan, commen
await helper.permit({ key: hypercoreid.decode(key), password })

comment('staging with encryption key')
const stagingB = helper.stage({ channel: `test-${id}`, dir, dryRun: false, bare: true })
const stagingB = helper.stage({ channel: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(stagingB))
const final = await Helper.pick(stagingB, { tag: 'final' })
ok(final.success, 'stage succeeded')
Expand Down
18 changes: 9 additions & 9 deletions test/05-updates.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const hypercoreid = require('hypercore-id-encoding')
const Helper = require('./helper')
const updates = path.join(Helper.localDir, 'test', 'fixtures', 'updates')
const seedOpts = (id) => ({ channel: `test-${id}`, name: `test-${id}`, key: null, dir: updates, cmdArgs: [] })
const stageOpts = (id, dir) => ({ ...seedOpts(id, dir), dryRun: false, bare: true, ignore: [] })
const stageOpts = (id, dir) => ({ ...seedOpts(id, dir), dryRun: false, ignore: [] })
const releaseOpts = (id, key) => ({ channel: `test-${id}`, name: `test-${id}`, key })
const ts = () => new Date().toISOString().replace(/[:.]/g, '-')
const rig = new Helper.Rig()
Expand Down Expand Up @@ -171,7 +171,7 @@ test('Pear.updates should notify Platform stage updates (different pear instance
const channel = 'test-fixture'

comment('staging app')
const appStaging = appStager.stage({ channel, name: channel, dir: updates, dryRun: false, bare: true })
const appStaging = appStager.stage({ channel, name: channel, dir: updates, dryRun: false })
teardown(() => Helper.teardownStream(appStaging))
const appFinal = await Helper.pick(appStaging, { tag: 'final' })
ok(appFinal.success, 'stage succeeded')
Expand Down Expand Up @@ -212,7 +212,7 @@ test('Pear.updates should notify Platform stage updates (different pear instance
teardown(() => { try { fs.unlinkSync(path.join(rig.artefactDir, file)) } catch { /* ignore */ } }, { order: -Infinity })

comment('restaging rig platform')
const staging = rig.local.stage({ channel: `test-${rig.id}`, name: `test-${rig.id}`, dir: rig.artefactDir, dryRun: false, bare: true })
const staging = rig.local.stage({ channel: `test-${rig.id}`, name: `test-${rig.id}`, dir: rig.artefactDir, dryRun: false })
teardown(() => Helper.teardownStream(staging))
await Helper.pick(staging, { tag: 'final' })
comment('rig platform restaged')
Expand Down Expand Up @@ -241,7 +241,7 @@ test('Pear.updates should notify Platform stage, Platform release updates (diffe
const channel = 'test-fixture'

comment('staging app')
const appStaging = appStager.stage({ channel, name: channel, dir: updates, dryRun: false, bare: true })
const appStaging = appStager.stage({ channel, name: channel, dir: updates, dryRun: false })
teardown(() => Helper.teardownStream(appStaging))
const appFinal = await Helper.pick(appStaging, { tag: 'final' })
ok(appFinal.success, 'stage succeeded')
Expand Down Expand Up @@ -283,7 +283,7 @@ test('Pear.updates should notify Platform stage, Platform release updates (diffe
teardown(() => { fs.unlinkSync(path.join(rig.artefactDir, file)) }, { order: -Infinity })

comment('restaging rig platform')
const staging = rig.local.stage({ channel: `test-${rig.id}`, name: `test-${rig.id}`, dir: rig.artefactDir, dryRun: false, bare: true })
const staging = rig.local.stage({ channel: `test-${rig.id}`, name: `test-${rig.id}`, dir: rig.artefactDir, dryRun: false })
teardown(() => Helper.teardownStream(staging))
await Helper.pick(staging, { tag: 'final' })
comment('rig platform restaged')
Expand Down Expand Up @@ -325,7 +325,7 @@ test('Pear.updates should notify App stage updates (different pear instances)',
const channel = 'test-fixture'

comment('staging app')
const appStaging = appStager.stage({ channel, name: channel, dir: updates, dryRun: false, bare: true })
const appStaging = appStager.stage({ channel, name: channel, dir: updates, dryRun: false })
teardown(() => Helper.teardownStream(appStaging))
const appFinal = await Helper.pick(appStaging, { tag: 'final' })
ok(appFinal.success, 'stage succeeded')
Expand Down Expand Up @@ -368,7 +368,7 @@ test('Pear.updates should notify App stage updates (different pear instances)',
const appStager2 = new Helper(rig)
teardown(() => appStager2.close(), { order: Infinity })
await appStager2.ready()
const appStaging2 = appStager2.stage({ channel, name: channel, dir: updates, dryRun: false, bare: true })
const appStaging2 = appStager2.stage({ channel, name: channel, dir: updates, dryRun: false })
teardown(() => Helper.teardownStream(appStaging2))
const appFinal2 = await Helper.pick(appStaging2, { tag: 'final' })
ok(appFinal2.success, 'stage succeeded')
Expand Down Expand Up @@ -397,7 +397,7 @@ test('Pear.updates should notify App stage, App release updates (different pear
const channel = 'test-fixture'

comment('staging app')
const appStaging = appStager.stage({ channel, name: channel, dir: updates, dryRun: false, bare: true })
const appStaging = appStager.stage({ channel, name: channel, dir: updates, dryRun: false })
teardown(() => Helper.teardownStream(appStaging))
const appFinal = await Helper.pick(appStaging, { tag: 'final' })
ok(appFinal.success, 'stage succeeded')
Expand Down Expand Up @@ -441,7 +441,7 @@ test('Pear.updates should notify App stage, App release updates (different pear
const appStager2 = new Helper(rig)
teardown(() => appStager2.close(), { order: Infinity })
await appStager2.ready()
const appStaging2 = appStager2.stage({ channel, name: channel, dir: updates, dryRun: false, bare: true })
const appStaging2 = appStager2.stage({ channel, name: channel, dir: updates, dryRun: false })
teardown(() => Helper.teardownStream(appStaging2))
const appFinal2 = await Helper.pick(appStaging2, { tag: 'final' })
ok(appFinal2.success, 'stage succeeded')
Expand Down
6 changes: 3 additions & 3 deletions test/06-shutdown.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test.hook('prepare low-spindown platform', async (t) => {
t.teardown(() => rigHelper.close(), { order: Infinity })
await rigHelper.ready()

const patchedStager = rigHelper.stage({ channel: 'test-spindown-ls', name: 'test-spindown-ls', dir: patchedArtefactDir, dryRun: false, bare: true })
const patchedStager = rigHelper.stage({ channel: 'test-spindown-ls', name: 'test-spindown-ls', dir: patchedArtefactDir, dryRun: false })
const patchedStagerUntil = await Helper.pick(patchedStager, [{ tag: 'final' }])
await patchedStagerUntil.final

Expand Down Expand Up @@ -149,7 +149,7 @@ test('sidecar should not spindown until ongoing update is finished', async (t) =
t.teardown(() => rigHelper.close(), { order: Infinity })
await rigHelper.ready()

const patchedStager = rigHelper.stage({ channel: 'test-spindown-throttled', name: 'test-spindown-throttled', dir: patchedArtefactDir, dryRun: false, bare: true })
const patchedStager = rigHelper.stage({ channel: 'test-spindown-throttled', name: 'test-spindown-throttled', dir: patchedArtefactDir, dryRun: false })
const patchedStagerUntil = await Helper.pick(patchedStager, [{ tag: 'final' }])
await patchedStagerUntil.final

Expand All @@ -175,7 +175,7 @@ test('sidecar should not spindown until ongoing update is finished', async (t) =
await rcvHelper.ready()

t.comment('\tStaging platform using rcv')
const stager = rcvHelper.stage({ channel: 'test-spindown', name: 'test-spindown', dir: rig.artefactDir, dryRun: false, bare: true })
const stager = rcvHelper.stage({ channel: 'test-spindown', name: 'test-spindown', dir: rig.artefactDir, dryRun: false })
const stagerUntil = await Helper.pick(stager, [{ tag: 'addendum' }, { tag: 'final' }])
const staged = await stagerUntil.addendum
await stagerUntil.final
Expand Down
10 changes: 5 additions & 5 deletions test/07-warmup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test('stage warmup with entrypoints', async function ({ ok, is, plan, comment, t
const id = Math.floor(Math.random() * 10000)

comment('staging')
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(staging))

const staged = await Helper.pick(staging, [{ tag: 'warming' }, { tag: 'final' }])
Expand All @@ -52,7 +52,7 @@ test('stage desktop app warmup with entrypoints', async function ({ ok, is, plan
const id = Math.floor(Math.random() * 10000)

comment('staging')
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(staging))

const staged = await Helper.pick(staging, [{ tag: 'warming' }, { tag: 'final' }])
Expand All @@ -77,7 +77,7 @@ test('stage warmup with prefetch', async function ({ ok, is, plan, comment, tear
const id = Math.floor(Math.random() * 10000)

comment('staging')
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(staging))

const staged = await Helper.pick(staging, [{ tag: 'warming' }, { tag: 'final' }])
Expand All @@ -101,7 +101,7 @@ test('staged bundle contains entries metadata', async function ({ ok, is, plan,
const id = Math.floor(Math.random() * 10000)

comment('staging')
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(staging))

const staged = await Helper.pick(staging, [{ tag: 'warming' }, { tag: 'final' }])
Expand Down Expand Up @@ -148,7 +148,7 @@ test('stage with ignore', async function ({ ok, is, plan, teardown }) {

const id = Math.floor(Math.random() * 10000)

const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false, bare: true })
const staging = helper.stage({ channel: `test-${id}`, name: `test-${id}`, dir, dryRun: false })
teardown(() => Helper.teardownStream(staging))

const stagingFiles = []
Expand Down
2 changes: 1 addition & 1 deletion test/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Rig {
comment('connected to sidecar')

comment('staging platform...')
const staging = this.local.stage({ channel: `test-${this.id}`, name: `test-${this.id}`, dir: this.artefactDir, dryRun: false, bare: true })
const staging = this.local.stage({ channel: `test-${this.id}`, name: `test-${this.id}`, dir: this.artefactDir, dryRun: false })
await Helper.pick(staging, { tag: 'final' })
comment('platform staged')

Expand Down
Loading