Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/openfeature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: OpenFeature

on:
pull_request:
push:
branches: [master]
schedule:
- cron: 0 4 * * *

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

env:
MOCHA_OPTIONS: ${{ github.ref == 'refs/heads/master' && '--retries 1' || '' }}

jobs:
unit:
strategy:
matrix:
version: [oldest, maintenance, active, latest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node
with:
version: ${{ matrix.version }}
- uses: ./.github/actions/install
- run: yarn test:openfeature:ci
- if: always()
uses: ./.github/actions/testagent/logs
with:
suffix: openfeature-${{ github.job }}-${{ matrix.version }}
- uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
- uses: DataDog/junit-upload-github-action@762867566348d59ac9bcf479ebb4ec040db8940a # v2.0.0
if: always()
with:
api_key: ${{ secrets.DD_API_KEY }}
service: dd-trace-js-tests

macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: ./.github/actions/node/latest
- uses: ./.github/actions/install
- run: yarn test:integration:openfeature
- uses: DataDog/junit-upload-github-action@762867566348d59ac9bcf479ebb4ec040db8940a # v2.0.0
if: always()
with:
api_key: ${{ secrets.DD_API_KEY }}
service: dd-trace-js-tests

ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: ./.github/actions/node/oldest-maintenance-lts
- uses: ./.github/actions/install
- run: yarn test:integration:openfeature
- uses: ./.github/actions/node/newest-maintenance-lts
- run: yarn test:integration:openfeature
- uses: ./.github/actions/node/active-lts
- run: yarn test:integration:openfeature
- uses: ./.github/actions/node/latest
- run: yarn test:integration:openfeature
- uses: DataDog/junit-upload-github-action@762867566348d59ac9bcf479ebb4ec040db8940a # v2.0.0
if: always()
with:
api_key: ${{ secrets.DD_API_KEY }}
service: dd-trace-js-tests

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: ./.github/actions/node/latest
- uses: ./.github/actions/install
with:
cache: 'true'
- run: yarn test:integration:openfeature
- uses: DataDog/junit-upload-github-action@762867566348d59ac9bcf479ebb4ec040db8940a # v2.0.0
if: always()
with:
api_key: ${{ secrets.DD_API_KEY }}
service: dd-trace-js-tests
38 changes: 23 additions & 15 deletions .github/workflows/test-optimization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,31 @@ jobs:
NODE_OPTIONS: '-r ./ci/init'
JEST_VERSION: ${{ matrix.jest-version }}

integration-ci:
integration-cucumber:
strategy:
matrix:
version: [oldest, latest]
cucumber-version: [7.0.0, latest]
runs-on: ubuntu-latest
env:
DD_SERVICE: dd-trace-js-integration-tests
DD_CIVISIBILITY_AGENTLESS_ENABLED: 1
DD_API_KEY: ${{ secrets.DD_API_KEY }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: ./.github/actions/node
with:
version: ${{ matrix.version }}
- uses: ./.github/actions/install
- run: yarn test:integration:cucumber
env:
NODE_OPTIONS: '-r ./ci/init'
CUCUMBER_VERSION: ${{ matrix.cucumber-version }}

integration-selenium:
strategy:
matrix:
version: [oldest, latest]
framework: [cucumber, selenium]
runs-on: ubuntu-latest
env:
DD_SERVICE: dd-trace-js-integration-tests
Expand All @@ -140,7 +160,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y google-chrome-stable
if [ $? -ne 0 ]; then echo "Failed to install Google Chrome"; exit 1; fi
if: ${{ matrix.framework == 'selenium' }}
- name: Install ChromeDriver
run: |
export CHROME_VERSION=$(google-chrome --version)
Expand All @@ -150,9 +169,8 @@ jobs:
unzip chromedriver-linux64.zip
sudo mv chromedriver-linux64/chromedriver /usr/bin/chromedriver
sudo chmod +x /usr/bin/chromedriver
if: ${{ matrix.framework == 'selenium' }}
- uses: ./.github/actions/install
- run: yarn test:integration:${{ matrix.framework }}
- run: yarn test:integration:selenium
env:
NODE_OPTIONS: '-r ./ci/init'

Expand Down Expand Up @@ -204,13 +222,3 @@ jobs:
- run: yarn test:integration:vitest
env:
NODE_OPTIONS: '-r ./ci/init'

plugin-cucumber:
runs-on: ubuntu-latest
env:
PLUGINS: cucumber
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: ./.github/actions/plugins/test
with:
dd_api_key: ${{ secrets.DD_API_KEY }}
2 changes: 1 addition & 1 deletion .gitlab/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variables:
stage: benchmarks
needs: [ ]
when: on_success
tags: ["runner:apm-k8s-tweaked-metal"]
tags: ["runner:apm-k8s-m7i-metal"]
image: $MICROBENCHMARKS_CI_IMAGE
interruptible: true
timeout: 15m # TODO: Fix worker queueing and reduce this.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
'use strict'

const { Before, Given, When, Then, setWorldConstructor } = require('@cucumber/cucumber')
const { expect } = require('chai')
const assert = require('assert')

const ENDPOINT_URL = process.env.DD_CIVISIBILITY_AGENTLESS_URL ||
`http://127.0.0.1:${process.env.DD_TRACE_AGENT_PORT}`

const CustomWorld = function () {
this.datadog = 0
Expand Down Expand Up @@ -31,18 +34,18 @@ When('run', () => {})
When('integration', function () {
const http = require('http')
return new Promise(resolve => {
http.request('http://test:123', () => {
http.request(`${ENDPOINT_URL}/info`, { agent: false }, () => {
resolve()
}).end()
})
})

Then('pass', function () {
expect(this.datadog).to.eql('datadog')
assert.equal(this.datadog, 'datadog')
})

Then('fail', function () {
expect(this.datadog).to.eql('godatad')
assert.equal(this.datadog, 'godatad')
})

Then('skip', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/** Some comment */
/**
* @datadog {"unskippable": true}
*/
/* Some other comment */
'use strict'

const { expect } = require('chai')
Expand Down
Loading
Loading