This directory contains integration tests for verifying Rush works correctly with different package managers after the tar 7.x upgrade.
Rush's npm and yarn modes use temp project tarballs (stored in common/temp/projects/) to simulate package installations. The tar library is used to:
- Create tarballs from temp project folders (
TempProjectHelper.createTempProjectTarball) - Extract tarballs during the linking process (
NpmLinkManager._linkProjectAsync)
These tests ensure the tar 7.x upgrade works correctly with these workflows.
The test suite is written in TypeScript using @rushstack/node-core-library for cross-platform compatibility.
Tests Rush npm mode by:
- Initializing a Rush repo with
npmVersionconfigured - Creating two projects with dependencies
- Running
rush update - Running
rush install - Running
rush build(verifies everything works end-to-end)
Tests Rush yarn mode by:
- Initializing a Rush repo with
yarnVersionconfigured - Creating two projects with dependencies
- Running
rush update - Running
rush install - Running
rush build(verifies everything works end-to-end)
Before running these tests:
- Build Rush locally:
rush build --to rush - Build this test project:
rush build --to rush-package-manager-integration-test - Ensure you have Node.js 18+ installed
# Build the test project first
cd build-tests/rush-package-manager-integration-test
rush build
# Run all tests
npm run testOr from the root of the repo:
rush build --to rush-package-manager-integration-test
cd build-tests/rush-package-manager-integration-test
npm run testThese integration tests verify:
- ✓ Temp project tarballs are created correctly using tar 7.x
- ✓ Tarballs are extracted correctly during
rush install - ✓ File permissions are preserved (tar filter function works)
- ✓ Dependencies are linked properly between projects
- ✓ The complete workflow (update → install → build) succeeds
- ✓ Built code executes correctly
Each test creates a temporary Rush repository in /tmp/rush-package-manager-test/:
/tmp/rush-package-manager-test/npm-test-repo/- npm mode test repository/tmp/rush-package-manager-test/yarn-test-repo/- yarn mode test repository
These directories are cleaned up at the start of each test run.
The tests use:
- TypeScript for type safety and better IDE support
- @rushstack/node-core-library for cross-platform file operations and process execution
- TestHelper class to encapsulate common test operations
- Modular test functions that can be run independently or together
The tar library is used in:
libraries/rush-lib/src/logic/TempProjectHelper.ts- Creates tarballslibraries/rush-lib/src/logic/npm/NpmLinkManager.ts- Extracts tarballs
If tests fail:
- Check that Rush built successfully:
rush build --to rush - Check that the test project built:
rush build --to rush-package-manager-integration-test - Verify Node.js version:
node --version(should be 18+) - Look for error messages in the test output
- Inspect the temp test repo:
ls -la temp/npm-test-repo/common/temp/projects/