Skip to content

Commit

Permalink
Add tests for pear stage (#249)
Browse files Browse the repository at this point in the history
* Add tests for pear stage

# Conflicts:
#	test/05-commands.test.js

* Enable commands test

# Conflicts:
#	test/index.js

* Make names more consistent

* Fix comment after test ends error

* Comment out tests that use --name

* Fix SIGPIPE error by switching to ipc destroy

* Fix wrong package.json being used

* Add ignoring of unparseable JSON

* Revert "Add ignoring of unparseable JSON"

This reverts commit 420bd44.

* Update tests that edit package.json to use temp dir

* Uncomment --name tests

* Use tmp platform to run test commands

* Use localdev to run command tests

* Use localdev for all command test runners

* Remove platformDir since we now have tests running with staged localdev

* Remove exit code checks due until Windows exit code bug is fixed

* Add TODO for readding exit code checks

* Remove exit code checks for initial stage

* Revert "Remove exit code checks for initial stage"

This reverts commit 2818a37.

* Revert "Add TODO for readding exit code checks"

This reverts commit b20422f.

* Revert "Remove exit code checks due until Windows exit code bug is fixed"

This reverts commit b65538f.

* Rename close to _close in harness to prevent overriding

* Use sync fs during brittle teardown

* Rename commands test prefix from 05 to 07

* Use Helper.localDir instead of Helper.root

* Switch helper back to use pearDir

* Revert "Switch helper back to use pearDir"

This reverts commit f03b1b6.

* Override platformDir when instantiating Helper from harness

* Cleanup todos

* Disable helper teardown when loaded from harness

* Add closing of the helper and use close instead of IPC destroy

* Remove rig

* Remove newlines in evaluate calls

* Add missing tags check

* Use Helper static field to signal if teardown should be skipped

* Remove skipping of teardown

* Use staged rig for all tests

* A logging of actual exit code

* Disable unused rig keepalive connection

* Temporarily disable non-failing tests

* Fix harness teardown using a non-existent runtime

* Add missing this

* Revert "Temporarily disable non-failing tests"

This reverts commit 82887b2.

* Add ensuring that rig has been shut down

* Use mirror.done instead of awaiting mirror output
  • Loading branch information
jkcdarunday authored Oct 23, 2024
1 parent 4ddadd2 commit 7a74a14
Show file tree
Hide file tree
Showing 5 changed files with 1,448 additions and 4 deletions.
8 changes: 7 additions & 1 deletion test/06-shutdown.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ test('sidecar should not spindown until ongoing update is finished', async (t) =

t.comment('\tStaging patched platform')
const rigHelper = new Helper(rig)
t.teardown(() => rigHelper.close(), { order: Infinity })
t.teardown(async () => {
if (!rigHelper.closing) {
await rigHelper.shutdown()
await 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 })
Expand All @@ -166,6 +171,7 @@ test('sidecar should not spindown until ongoing update is finished', async (t) =
t.teardown(() => Helper.gc(platformDirRcv))

await Helper.teardownStream(patchedSeeder)
await rigHelper.shutdown()
await rigHelper.close()

t.comment('2. Start patched rcv platform')
Expand Down
Loading

0 comments on commit 7a74a14

Please sign in to comment.