Skip to content

Commit

Permalink
Merge branch 'main' into dluna-fix-merge-props-fun
Browse files Browse the repository at this point in the history
  • Loading branch information
david-luna committed Jan 9, 2025
2 parents 68cdaa2 + 4465009 commit 3041889
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .ci/scripts/benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ NODEJS_VERSION=14

USER_ID="${USER_ID}" \
NODEJS_VERSION="${NODEJS_VERSION}" \
docker compose -f ./dev-utils/docker-compose.yml down \
docker-compose -f ./dev-utils/docker-compose.yml down \
--remove-orphans \
--volumes || true

USER_ID="${USER_ID}" \
NODEJS_VERSION="${NODEJS_VERSION}" \
docker compose -f ./dev-utils/docker-compose.yml up \
docker-compose -f ./dev-utils/docker-compose.yml up \
--build \
--abort-on-container-exit \
--exit-code-from node-benchmark \
Expand Down
4 changes: 2 additions & 2 deletions .ci/scripts/load-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ NODEJS_VERSION=14
USER_ID="${USER_ID}" \
NODEJS_VERSION="${NODEJS_VERSION}" \
STACK_VERSION=${STACK_VERSION} \
docker compose -f ./dev-utils/docker-compose.yml down \
docker-compose -f ./dev-utils/docker-compose.yml down \
--remove-orphans \
--volumes || true

USER_ID="${USER_ID}" \
NODEJS_VERSION="${NODEJS_VERSION}" \
STACK_VERSION=${STACK_VERSION} \
docker compose -f ./dev-utils/docker-compose.yml up \
docker-compose -f ./dev-utils/docker-compose.yml up \
--build \
--exit-code-from load-testing \
load-testing
25 changes: 23 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
matrix:
stack-version:
- '8.0.0-SNAPSHOT'
- '8.15.5'
- '8.16.2'
scope:
- '@elastic/apm-rum'
- '@elastic/apm-rum-core'
Expand All @@ -82,11 +82,32 @@ jobs:
scope: ${{ matrix.scope }}
stack-version: ${{ matrix.stack-version }}

npm-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Temporary fix for "ValueError: invalid mode: 'rU' while trying to load binding.gyp"
# See https://github.com/nodejs/node-gyp/issues/2219
# This can be removed when "node-gyp" is updated
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install dependencies
run: npm ci

all:
if: always()
runs-on: ubuntu-latest
needs:
- lint
- npm-ci
- test-puppeteer
steps:
- id: check
Expand All @@ -104,4 +125,4 @@ jobs:
uses: ./.github/workflows/run-test
with:
goal: 'coverage'
stack-version: '8.15.5'
stack-version: '8.16.2'
4 changes: 2 additions & 2 deletions .github/workflows/microbenchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
inputs:
stack_version:
description: 'Stack Version'
default: '8.15.5'
default: '8.16.2'
required: false
push:
branches:
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Run buildkite pipeline
uses: elastic/oblt-actions/buildkite/run@v1
env:
STACK_VERSION: ${{ inputs.stack_version || '8.15.5' }}
STACK_VERSION: ${{ inputs.stack_version || '8.16.2' }}
with:
token: ${{ secrets.BUILDKITE_TOKEN }}
pipeline: apm-agent-microbenchmark
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ jobs:
with:
github-token: ${{ steps.get_token.outputs.token }}

# Temporary fix for "ValueError: invalid mode: 'rU' while trying to load binding.gyp"
# See https://github.com/nodejs/node-gyp/issues/2219
# This can be removed when "node-gyp" is updated
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
Expand All @@ -71,6 +79,7 @@ jobs:
- name: Publish the release
env:
DRY_RUN: "${{ inputs.dry-run }}"
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
npm run ci:release
Expand Down
1 change: 1 addition & 0 deletions packages/rum-core/test/common/xhr-patch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ describe('xhrPatch', function () {
const req = new window.XMLHttpRequest()
const getEvents = registerEventListener(req)
req.open('GET', 'https://elastic.co/guide', true)
req.timeout = 1
req.addEventListener('loadend', () => {
expect(getEvents(done).map(e => e.event)).toEqual(['schedule', 'invoke'])
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,13 @@ describe('PerformanceMonitoring', function () {

it('should notify when a transaction has been filtered out', function () {
spyOn(configService, 'dispatchEvent')
var tr = new Transaction('transaction-no-duration', 'transaction-type')
tr.end()
// NOTE: tests in SauceLabs fail because the duration becomes 1. Setting the start & end
// times will ensure `duration` is 0.
var now = Date.now()
var tr = new Transaction('transaction-no-duration', 'transaction-type', {
startTime: now
})
tr.end(now)

var payload = performanceMonitoring.createTransactionPayload(tr)
expect(payload).toBeUndefined()
Expand Down
7 changes: 1 addition & 6 deletions scripts/ci-release.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,14 @@ async function dryRunMode() {
async function prodMode() {
console.log('Running in prod mode')

const totpCode = process.env.TOTP_CODE
if (totpCode == null || totpCode === '') {
raiseError("The 'TOTP_CODE' env var isn't defined")
}

const githubToken = process.env.GITHUB_TOKEN
if (githubToken == null || githubToken === '') {
raiseError("The 'GITHUB_TOKEN' env var isn't defined")
}

try {
await execa('npx',
['lerna', 'publish', 'from-package', `--otp=${totpCode}`, '--no-push', '--no-git-tag-version', '--no-changelog', '--yes'],
['lerna', 'publish', 'from-package', '--no-push', '--no-git-tag-version', '--no-changelog', '--yes'],
{ stdin: process.stdin}
)
.pipeStdout(process.stdout)
Expand Down

0 comments on commit 3041889

Please sign in to comment.