Skip to content

Commit

Permalink
ci: use unique test file names for parallel tests
Browse files Browse the repository at this point in the history
- Add TEST_FILE_NAME environment variable
- Make test file unique per Node.js version
  • Loading branch information
vkartk committed Jan 16, 2025
1 parent 55d6d0b commit 414cd4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test
env:
BUNNY_ACCESS_KEY: ${{ secrets.BUNNY_ACCESS_KEY }}
BUNNY_STORAGE_ZONE: ${{ secrets.BUNNY_STORAGE_ZONE }}
TEST_FILE_NAME: test-file-node-${{ matrix.node-version }}.txt
4 changes: 3 additions & 1 deletion test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BunnyStorage } from './src/index.js';
import { writeFileSync, unlinkSync } from 'node:fs';
import { join } from 'node:path';

const TEST_FILE_NAME = 'test-file.txt';
const TEST_FILE_NAME = process.env.TEST_FILE_NAME || 'test-file.txt';
const TEST_CONTENT = 'Hello, Bunny Storage!';
const REMOTE_PATH = 'test-folder'; // Folder will be created automatically on upload

Expand All @@ -22,6 +22,8 @@ async function runTests() {
}

console.log('🧪 Starting Bunny Storage tests...');
console.log(`Using test file: ${TEST_FILE_NAME}`);
console.log(`Using remote path: ${REMOTE_PATH}`);

try {
// Create a local test file
Expand Down

0 comments on commit 414cd4f

Please sign in to comment.