Conversation
fix: folder status on creation fix: failing IT cases
bosi95
marked this pull request as ready for review
August 3, 2026 12:07
chore: recoverFolder unit test
Member
|
Could you confirm that the new test specs have the same coverage as the old tests? A before/after coverage comprassion would be helpful. |
ferencsarai
approved these changes
Aug 8, 2026
There was a problem hiding this comment.
Pull request overview
Reworks the v2 test suite to be split into focused unit/integration domains, and updates the integration environment + CI to use @ethersphere/bee-factory instead of custom shell bootstrapping.
Changes:
- Split the former monolithic unit/integration specs into per-capability suites and introduced shared test helpers.
- Switched integration test provisioning to
bee-factoryvia JestglobalSetup/globalTeardown, and updated docs accordingly. - Updated CI to always run unit tests, and to run integration tests only on
master/developpushes, manual dispatch, PRs targetingmaster, or PRs labeledrun-it.
Reviewed changes
Copilot reviewed 43 out of 46 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tsconfig.json |
Includes tests/ in typechecking and removes deprecated compiler option override. |
tests/utils.ts |
Central shared test utilities (bee URLs, signers, init helper, stream/retry helpers). |
tests/unit/setup.ts |
Centralizes Jest module mocks for unit tests via setupFilesAfterEnv. |
tests/unit/mock.ts |
Provides unit mock factories, Bee spies, and cache seeding helpers. |
tests/unit/init.spec.ts |
New unit coverage for initialization and reinitialization behaviors. |
tests/unit/drive.spec.ts |
New unit coverage for drive create/destroy/forget flows. |
tests/unit/file.spec.ts |
New unit coverage for file upload/download/update/move behaviors. |
tests/unit/folder.spec.ts |
New unit coverage for folder list/download/create/move behaviors. |
tests/unit/version.spec.ts |
New unit coverage for version fetch/restore behavior. |
tests/unit/trash.spec.ts |
New unit coverage for trash/recover/listTrash/forget lifecycle. |
tests/unit/events.spec.ts |
New unit coverage for emitted events and deterministic payload expectations. |
tests/unit/abort.spec.ts |
New unit coverage for abort-signal forwarding/guards. |
tests/unit/fileManager.spec.ts |
Removes the old monolithic unit spec in favor of per-domain suites. |
tests/integration/setup/jestSetup.ts |
Starts bee-factory stack before integration tests. |
tests/integration/setup/jestTeardown.ts |
Stops bee-factory stack after integration tests. |
tests/integration/setup/utils.ts |
Adds integration fixtures (setupUserDrive, temp file registry, signer+stamp helper). |
tests/integration/init.spec.ts |
New integration coverage for initialization, admin feed/topic behavior, and revalidation. |
tests/integration/drive.spec.ts |
New integration coverage for drive create/forget/destroy guardrails. |
tests/integration/file.spec.ts |
New integration coverage for upload(s), update, download(s), and move behaviors. |
tests/integration/folder.spec.ts |
New integration coverage for listFolder/downloadFolder and folder moves. |
tests/integration/version.spec.ts |
New integration coverage for versioning, lazy hydration, restore semantics. |
tests/integration/trash.spec.ts |
New integration coverage for trash/recover/forget lifecycle and dedupe guarantees. |
tests/integration/abort.spec.ts |
New integration coverage for abort behavior across upload/download/listFolder. |
tests/integration/e2e.spec.ts |
New end-to-end workflow integration coverage. |
tests/integration/testSetupHelpers.ts |
Removes old integration bootstrap helper (superseded by setup utils + bee-factory). |
tests/integration/test-node-setup/runBeeNode.sh |
Removes legacy shell-based Bee bootstrap. |
tests/integration/test-node-setup/stopBeeNode.sh |
Removes legacy shell-based Bee teardown. |
tests/integration/test-node-setup/jestSetup.ts |
Removes legacy Jest globalSetup for shell bootstrap. |
tests/integration/test-node-setup/jestTeardown.ts |
Removes legacy Jest globalTeardown for shell bootstrap. |
tests/TESTS.md |
Updates test documentation for new suite layout, bee-factory, and helper patterns. |
tests/fixtures/test.txt |
Removes static fixture (tests now generate temp inputs). |
tests/fixtures/nested/nested.txt |
Removes static fixture (tests now generate temp inputs). |
tests/fixtures/nested/extra/extra.txt |
Removes static fixture (tests now generate temp inputs). |
tests/fixtures/folder/1.txt |
Removes static fixture (tests now generate temp inputs). |
tests/fixtures/data.txt |
Removes static fixture (tests now generate temp inputs). |
src/fileManager.ts |
Ensures created folders are explicitly marked NodeStatus.Active. |
pnpm-workspace.yaml |
Expands allowBuilds to include additional native/build-time deps. |
package.json |
Adds @ethersphere/bee-factory, adjusts test scripts, and introduces an override for bee-js in bee-factory. |
jest.config.ts |
Splits Jest config into unit and integration projects; wires unit setup file and new global setup/teardown. |
eslint.config.mjs |
Adds Response global and relaxes explicit return type rule for Jest suite ergonomics. |
changelog/v2-tests.md |
Adds a changelog entry documenting the test suite reorg and CI changes. |
.github/workflows/tests.yaml |
Updates CI to always run unit tests and conditionally run integration tests; adds concurrency cancelation. |
.depcheckrc.json |
Updates depcheck ignores to account for @ethersphere/bee-factory. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+57
to
70
| export async function retryOnPropagationDelay<T>(fn: () => Promise<T>, attempts = 5, delayMs = 500): Promise<T> { | ||
| let lastError: unknown; | ||
| for (let i = 0; i < attempts; i++) { | ||
| try { | ||
| return await fn(); | ||
| } catch (err: unknown) { | ||
| lastError = err; | ||
| if (i < attempts - 1) { | ||
| await new Promise((resolve) => setTimeout(resolve, delayMs)); | ||
| } | ||
| } | ||
| } | ||
| throw lastError; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v2/tests — suite reorg, bee-factory environment, CI
Test environment (bee-factory)
jest.config.tsnow defines two projects,unitandintegration, selectable via--selectProjects.globalSetup/globalTeardown(tests/integration/setup/jestSetup.ts/jestTeardown.ts) provisionthe Bee nodes with
@ethersphere/bee-factory— queen at127.0.0.1:1633, worker at127.0.0.1:1635. This replacesthe shell-script bootstrap (
tests/integration/test-node-setup/*.sh+ its jest setup/teardown), which is removed.package.jsongains thebee-factorydev dependency and thetest,test:ut,test:it,test:coveragescripts.Suite reorganization
The monolithic
tests/integration/fileManager.spec.tsandtests/unit/fileManager.spec.tsare split intoper-capability suites:
tests/integration/):abort,drive,e2e,file,folder,init,trash,version.tests/unit/):abort,drive,events,file,folder,init,trash,version.Trash suites cover the full lifecycle for both files and folders (trash / recover / forget).
Shared fixtures & helpers
tests/integration/setup/utils.ts(new) —setupUserDrive(single-call bee + FileManager + drive fixture),tempFileRegistry(temp files are tracked and removed by oneafterAll, so no temporary file survives a run), andensureUniqueSignerWithStamp.tests/unit/setup.ts(new) — centralizesjest.mockand exposesapplyDefaultMocks;tests/unit/mock.ts(record /drive seeding) replaces
tests/mockHelpers.ts.tests/utils.ts— shared node URLs, mock signers,retryOnPropagationDelay, andcreateInitializedFileManager.tests/fixtures/*inputs are removed — suites write their inputs throughtempFileRegistryinstead.CI (
.github/workflows/tests.yaml)master/develop.master/develop, manual dispatch, aPR targeting
master, or a PR carrying therun-itlabel.concurrencygroup cancels superseded runs on the same ref.Docs
tests/TESTS.mdrewritten for the two-project layout, bee-factory prerequisites, the shared-helper model, andper-suite coverage.
Gate
pnpm run lintandbuildcleanpnpm run testclean, every test case and suite passes.