Skip to content

Commit 737bab5

Browse files
authored
chore: remove node-pupeteer image for tests & fix release in dry-run mode (#1683)
1 parent be10df3 commit 737bab5

File tree

14 files changed

+417
-266
lines changed

14 files changed

+417
-266
lines changed

.ci/docker/node-puppeteer/Dockerfile

Lines changed: 0 additions & 46 deletions
This file was deleted.

.ci/docker/node-puppeteer/run-test.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 31 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,9 @@ jobs:
4040
- run: '.ci/scripts/lint.sh'
4141
- run: 'npm run ci:bundlesize'
4242
id: bundlesize
43-
# TODO: This fails on forked PRs
44-
# - uses: actions/github-script@v6
45-
# env:
46-
# BUNDLESIZE_PASS: ${{ steps.bundlesize.outputs.bundlesize_pass }}
47-
# BUNDLESIZE_FAIL: ${{ steps.bundlesize.outputs.bundlesize_fail }}
48-
# with:
49-
# script: |
50-
# const { BUNDLESIZE_PASS, BUNDLESIZE_FAIL } = process.env;
51-
# let state = 'success';
52-
# if (BUNDLESIZE_FAIL > 0) {
53-
# state = 'failure';
54-
# }
55-
# github.rest.repos.createCommitStatus({
56-
# ...context.repo,
57-
# sha: context.sha,
58-
# state: state,
59-
# context: `${context.workflow} / Bundlesize: ${BUNDLESIZE_PASS} pass / ${BUNDLESIZE_FAIL} fail`,
60-
# });
6143

62-
test-puppeteer:
63-
name: Test Puppeteer
44+
test:
45+
name: Test
6446
runs-on: ubuntu-latest
6547
strategy:
6648
matrix:
@@ -75,47 +57,45 @@ jobs:
7557
- '@elastic/apm-rum-vue'
7658
steps:
7759
- uses: actions/checkout@v6
78-
79-
- name: Run puppeteer tests
80-
uses: ./.github/workflows/run-test
81-
with:
82-
goal: 'test'
83-
scope: ${{ matrix.scope }}
84-
stack-version: ${{ matrix.stack-version }}
85-
86-
npm-ci:
87-
runs-on: ubuntu-latest
88-
steps:
89-
- uses: actions/checkout@v6
90-
9160
- uses: actions/setup-node@v6
9261
with:
9362
node-version-file: '.nvmrc'
94-
63+
- name: Start Stack
64+
run: docker compose -f ./dev-utils/docker-compose.yml up -d fleet-server
65+
env:
66+
STACK_VERSION: ${{ matrix.stack-version }}
9567
- name: Install dependencies
9668
run: npm ci
97-
98-
all:
99-
if: always()
100-
runs-on: ubuntu-latest
101-
needs:
102-
- lint
103-
- npm-ci
104-
- test-puppeteer
105-
steps:
106-
- id: check
107-
uses: elastic/oblt-actions/check-dependent-jobs@v1
108-
with:
109-
jobs: ${{ toJSON(needs) }}
110-
- run: ${{ steps.check.outputs.is-success }}
69+
- name: Run Tests
70+
run: npm run test
71+
env:
72+
SCOPE: ${{ matrix.scope }}
11173

11274
coverage:
11375
name: Coverage
11476
runs-on: ubuntu-latest
11577
steps:
11678
- uses: actions/checkout@v6
79+
- uses: actions/setup-node@v6
80+
with:
81+
node-version-file: '.nvmrc'
82+
- name: Start Stack
83+
run: docker compose -f ./dev-utils/docker-compose.yml up -d fleet-server
84+
env:
85+
STACK_VERSION: 8.19.8
86+
- name: Install dependencies
87+
run: npm ci
11788
- name: Run coverage
118-
uses: ./.github/workflows/run-test
89+
run: npm run coverage
90+
# The upload-artifact action fails if the name contains slashes `/` or colons `:`.
91+
# This step creates a slugified version that will not contain these characters.
92+
- uses: gacts/github-slug@91cb78e803e07ccf88570afeddeabaad93c8f4cb # 1.3.4
93+
id: slug
94+
with:
95+
to-slug: coverage-8.19.8
96+
- name: Store test results
97+
uses: actions/upload-artifact@v6
11998
with:
120-
goal: 'coverage'
121-
stack-version: '8.19.8'
99+
name: test-results-${{ steps.slug.outputs.slug }}
100+
path: |
101+
packages/**/reports/TESTS-*.xml

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
8686

8787
- id: 'upload-files-version'
88-
if: ${{ always() && hashFiles('packages/rum/dist/bundles/*.js') }}
88+
if: ${{ inputs.dry-run == false && hashFiles('packages/rum/dist/bundles/*.js') }}
8989
uses: 'google-github-actions/upload-cloud-storage@v3'
9090
with:
9191
parent: false
@@ -97,7 +97,7 @@ jobs:
9797
cache-control: public,max-age=31536000,immutable
9898
9999
- id: 'upload-files-major-version'
100-
if: ${{ always() && hashFiles('packages/rum/dist/bundles/*.js') }}
100+
if: ${{ inputs.dry-run == false && hashFiles('packages/rum/dist/bundles/*.js') }}
101101
uses: 'google-github-actions/upload-cloud-storage@v3'
102102
with:
103103
parent: false
@@ -109,7 +109,7 @@ jobs:
109109
cache-control: public,max-age=604800,immutable
110110
111111
- id: 'upload-file-index'
112-
if: ${{ always() && hashFiles('index.html') }}
112+
if: ${{ inputs.dry-run == false && hashFiles('index.html') }}
113113
uses: 'google-github-actions/upload-cloud-storage@v3'
114114
with:
115115
parent: false

.github/workflows/run-test/action.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ $ npx lerna bootstrap
8686
Tests fall under unit, integration and end-to-end tests. Before running the test, we have to start the APM server manually since all the APM payload data are sent to the server.
8787

8888
```sh
89-
NODEJS_VERSION=<nodeVersion> STACK_VERSION=<version> docker compose -f ./dev-utils/docker-compose.yml up -d apm-server
89+
NODEJS_VERSION=<nodeVersion> STACK_VERSION=<version> docker compose -f ./dev-utils/docker-compose.yml up -d fleet-server
9090
# nodeVersion - corresponds to NodeJS version to be used when building the test images
9191
# version - corresponds to Elastic Stack versions
9292
```

dev-utils/docker-compose.yml

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -129,40 +129,6 @@ services:
129129
aliases:
130130
- wait-for-apm-server
131131

132-
node-puppeteer:
133-
build:
134-
context: ../.ci/docker/node-puppeteer
135-
args:
136-
- NODEJS_VERSION=${NODEJS_VERSION}
137-
container_name: node-puppeteer
138-
image: docker.elastic.co/observability-ci/node-puppeteer:${NODEJS_VERSION}
139-
environment:
140-
- HOME=/app
141-
- SCOPE=${SCOPE}
142-
- STACK_VERSION=${STACK_VERSION}
143-
- APM_SERVER_URL=${APM_SERVER_URL}
144-
- KIBANA_URL=${KIBANA_URL}
145-
- BUILD_NUMBER=${BUILD_NUMBER}
146-
- BRANCH_NAME=${BRANCH_NAME}
147-
- CI=${CI}
148-
- MODE=${MODE}
149-
- GOAL=${GOAL}
150-
- WORKSPACE=${WORKSPACE}
151-
- BASE_DIR=${BASE_DIR}
152-
command: /run-test.sh
153-
mem_limit: 2000m
154-
# cpus: 0.5
155-
depends_on:
156-
fleet-server:
157-
condition: service_healthy
158-
volumes:
159-
- ..:/app
160-
networks:
161-
apm:
162-
aliases:
163-
- node-puppeteer
164-
user: ${USER_ID}
165-
166132
node-benchmark:
167133
build:
168134
context: ../.ci/docker/node-playwright

0 commit comments

Comments
 (0)