Skip to content

Commit

Permalink
Merge branch 'main' into michalpiechowiak/frb-1544-bunlock-not-select…
Browse files Browse the repository at this point in the history
…ing-bun-bunlockb-works
  • Loading branch information
pieh authored Jan 8, 2025
2 parents e106db4 + eee459c commit 05d9e16
Show file tree
Hide file tree
Showing 40 changed files with 1,251 additions and 1,027 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stalebot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-24.04
steps:
- uses: actions/stale@v6.0.1
- uses: actions/stale@v9.0.0
with:
exempt-issue-labels: 'WIP,security,action_item,never_stale'
days-before-issue-stale: 365
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typescript-nudge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- name: 🔎 Get changed JavaScript files
id: changed-javascript-files
uses: tj-actions/changed-files@v36
uses: tj-actions/changed-files@v45
with:
base_sha: ${{ github.event.pull_request.base.sha }}
files: |
Expand Down
22 changes: 3 additions & 19 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ jobs:
deno-version: 'v1.46.3'
fail-fast: false
steps:
# Increasing the maximum number of open files. See:
# https://github.com/actions/virtual-environments/issues/268
- name: Increase open file limit
run: sudo ulimit -Sn 65536
if: "${{ matrix.os == 'macos-14' }}"
- run: git config --global core.symlinks true
# Sets an output parameter if this is a release PR
- name: Check for release
id: release-check
Expand Down Expand Up @@ -109,13 +103,8 @@ jobs:
run: npx nx affected --target=build
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- name: Tests
uses: nick-fields/retry@v3
run: npx nx affected --target=test:ci --exclude=@netlify/build --parallel=3
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
with:
timeout_minutes: 30
max_attempts: 3
retry_on: error
command: npx nx affected --target=test:ci --exclude=@netlify/build --parallel=3

test-build:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -193,17 +182,12 @@ jobs:
run: npm run build
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- name: Tests
uses: nick-fields/retry@v3
run: npx lerna run test:ci --scope @netlify/build
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
env:
# split tests across multiple machines
CI_NODE_INDEX: ${{ matrix.machine }}
CI_NODE_TOTAL: 4
with:
timeout_minutes: 30
max_attempts: 3
retry_on: error
command: npx lerna run test:ci --scope @netlify/build
CI_NODE_TOTAL: 5
- name: Get test coverage flags
id: test-coverage-flags
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
Expand Down
6 changes: 0 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ See our [testing documentation](packages/build/tests/README.md) to learn about o

After submitting the pull request, please make sure the Continuous Integration checks (GitHub actions) are passing.

### Testing in CI

To speed up CI, we load balance the tests across multiple machines. The information required to load balance the tests
is stored in `tests-metadata.json`, and later used by our test [runner](ava.config.js#L10). To regenerate the data (e.g.
when adding a new test file) run `npm test:measure` and commit the changes to GitHub.

### Testing locally

The `@netlify/testing` package will need to be built regardless of which package you are working on. In order to do this
Expand Down
20 changes: 0 additions & 20 deletions ava.base.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
import fs, { existsSync } from 'fs'
import path from 'path'
import process from 'process'

import { isCI } from 'ci-info'
import * as execa from 'execa'

const { execaCommand } = execa
if (process.argv.includes('-w')) {
execaCommand('tsc -w', { cleanup: true })
}

// `tests-metadata.json` is created by running `npx lerna run test:measure --scope @netlify/build`
const testData = existsSync('tests-metadata.json') ? JSON.parse(fs.readFileSync('tests-metadata.json', 'utf-8')) : {}

const getOrder = (file) => {
const fileRelative = path.relative(process.cwd(), file).replace(/\\/g, '/')
if (testData[fileRelative]) {
return testData[fileRelative].order
}

console.warn(`Missing test metadata for ${fileRelative}`)
return Number.MAX_SAFE_INTEGER
}

const sortTestFiles = (file1, file2) => getOrder(file1) - getOrder(file2)

const config = {
files: ['packages/**/tests/*.{cjs,mjs,js}', 'packages/**/tests/**/tests.{cjs,mjs,js}'],
verbose: true,
Expand All @@ -34,8 +16,6 @@ const config = {
environmentVariables: {
FORCE_COLOR: '1',
},
// we only sort in CI to split efficiently across machines
...(isCI && { sortTestFiles }),
}

export default config
Loading

0 comments on commit 05d9e16

Please sign in to comment.