From ae863a3af9afa2458f61eb602029ebf2449b406d Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:45:13 -0600 Subject: [PATCH 1/7] wip --- .buildkite/pipeline.yml | 10 +++++++++- packages/browser/Makefile | 14 +++++--------- packages/browser/scripts/ci.sh | 15 --------------- 3 files changed, 14 insertions(+), 25 deletions(-) delete mode 100755 packages/browser/scripts/ci.sh diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index f5acdb609..2aea9183d 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -40,7 +40,13 @@ steps: - npm config set "//registry.npmjs.org/:_authToken" $${NPM_TOKEN} - echo "--- Install dependencies" - yarn install --immutable - - yarn run -T browser exec make ci + - echo "--- Build bundles" + - yarn run -T browser . build + - echo '--- Check Size limit' + - yarn run -T browser size-limit + - echo "+++ Run tests" + - yarn run -T browser lint + - yarn run -T browser test plugins: - ssh://git@github.com/segmentio/cache-buildkite-plugin#v2.0.0: key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}" @@ -174,6 +180,8 @@ steps: - yarn install --immutable - echo "+++ Run Destinations QA Tests :pray:" - yarn run -T browser exec make test-qa-destinations + - yarn run -T browser exec make test-integration + - yarn run -T browser exec make test-perf soft_fail: - exit_status: '*' plugins: diff --git a/packages/browser/Makefile b/packages/browser/Makefile index af62a83d3..2e58918dc 100644 --- a/packages/browser/Makefile +++ b/packages/browser/Makefile @@ -35,19 +35,19 @@ test-unit: node_modules ## Runs unit tests $(yarn_run) test .PHONY: test-unit -test-qa: build-browser ## Runs all QA tests in a single command +test-qa: build-browser COVERAGE=false $(yarn_run) test --runTestsByPath qa/__tests__/*.test.ts --testPathIgnorePatterns qa/__tests__/destinations.test.ts --reporters="default" --reporters="/qa/lib/jest-reporter.js" ${args} .PHONY: test-qa -test-qa-destinations: build-browser ## Runs Destination QA tests. options. DESTINATION=amplitude DEBUG=true +test-qa-destinations: build-browser COVERAGE=false $(yarn_run) test --forceExit --runTestsByPath qa/__tests__/destinations.test.ts --reporters="default" --reporters="/qa/lib/jest-reporter.js" ${args} -.PHONY: test-qa-destinations +.PHONY: test- -test-integration: build ## Runs all integration tests in a single command +test-integration: build COVERAGE=false $(yarn_run) test --forceExit --runTestsByPath e2e-tests/**/*.test.ts ${args} .PHONY: test-integration -test-perf: build ## Runs all integration tests in a single command +test-perf: build $(yarn_run) test --forceExit --runTestsByPath e2e-tests/performance/*.test.ts ${args} .PHONY: test-perf @@ -55,10 +55,6 @@ lint: node_modules ## Lints the source code $(yarn_run) lint .PHONY: lint -ci: - bash ./scripts/ci.sh -.PHONY: ci - handshake: @echo "📡 Establishing Remote connection" @robo --config ~/dev/src/github.com/segmentio/robofiles/development/robo.yml prod.ssh echo "✅ Connected" diff --git a/packages/browser/scripts/ci.sh b/packages/browser/scripts/ci.sh deleted file mode 100755 index 1f3b497f5..000000000 --- a/packages/browser/scripts/ci.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -set -e - -echo '--- Build bundles' -make build - -echo '--- Check Size' -yarn run -T browser size-limit - -echo '--- Lint files' -make lint - -echo '--- Run tests' -make test-unit -make test-integration From 77104fb15ff18480f6d6d3afd11234381c6423d3 Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:47:33 -0600 Subject: [PATCH 2/7] wip --- .buildkite/pipeline.yml | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 2aea9183d..6952dc4b3 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -86,6 +86,8 @@ steps: - PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npx playwright install - echo "+++ Run Browser integration tests :pray:" - PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers yarn turbo run --filter=browser-integration-tests test + - yarn run -T browser exec make test-integration + - yarn run -T browser exec make test-perf retry: automatic: - exit_status: '*' @@ -94,7 +96,26 @@ steps: - ssh://git@github.com/segmentio/cache-buildkite-plugin#v2.0.0: key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}" paths: ['.yarn/cache/'] - + + - label: ':thisisfine: [Browser] Destinations QA / E2E' + key: destinations + agents: + queue: v1 + env: + COVERAGE: false + commands: + - npm config set "//registry.npmjs.org/:_authToken" $${NPM_TOKEN} + - echo "--- Install dependencies" + - yarn install --immutable + - echo "+++ Run Integration Tests :pray:" + - yarn run -T browser exec make test-qa-destinations + soft_fail: + - exit_status: '*' + plugins: + - ssh://git@github.com/segmentio/cache-buildkite-plugin#v2.0.0: + key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}" + paths: ['.yarn/cache/'] + - label: '[Core] Lint + Test' env: SEGMENT_CODECOV_FLAGS: 'core' @@ -168,27 +189,6 @@ steps: key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}" paths: ['.yarn/cache/'] - - label: ':thisisfine: [Browser] Destinations QA / E2E' - key: destinations - agents: - queue: v1 - env: - COVERAGE: false - commands: - - npm config set "//registry.npmjs.org/:_authToken" $${NPM_TOKEN} - - echo "--- Install dependencies" - - yarn install --immutable - - echo "+++ Run Destinations QA Tests :pray:" - - yarn run -T browser exec make test-qa-destinations - - yarn run -T browser exec make test-integration - - yarn run -T browser exec make test-perf - soft_fail: - - exit_status: '*' - plugins: - - ssh://git@github.com/segmentio/cache-buildkite-plugin#v2.0.0: - key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}" - paths: ['.yarn/cache/'] - - label: '[Browser] Release to CDN :rocket:' branches: '!v* !@segment/* !publish-test' agents: From d80b9d0887f96de2840f5b3a52437da8a1b18ae4 Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:50:16 -0600 Subject: [PATCH 3/7] wip --- packages/browser/Makefile | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/browser/Makefile b/packages/browser/Makefile index 2e58918dc..47d7c7ece 100644 --- a/packages/browser/Makefile +++ b/packages/browser/Makefile @@ -13,10 +13,6 @@ node_modules: yarn install --immutable @touch $@ -build-browser: build # build dependencies - $(yarn_run) umd --no-stats -.PHONY: build-browser - build: ## Builds libraries in prod mode, and all dependencies yarn run -T browser . build .PHONY: build @@ -25,21 +21,15 @@ clean: ## Clean the build directory rm -rf dist generated .PHONY: clean -## Test Commands - -tdd: node_modules ## Runs unit tests in watch mode - $(yarn_run) test --watch -.PHONY: tdd - test-unit: node_modules ## Runs unit tests $(yarn_run) test .PHONY: test-unit -test-qa: build-browser +test-qa: build COVERAGE=false $(yarn_run) test --runTestsByPath qa/__tests__/*.test.ts --testPathIgnorePatterns qa/__tests__/destinations.test.ts --reporters="default" --reporters="/qa/lib/jest-reporter.js" ${args} .PHONY: test-qa -test-qa-destinations: build-browser +test-qa-destinations: build COVERAGE=false $(yarn_run) test --forceExit --runTestsByPath qa/__tests__/destinations.test.ts --reporters="default" --reporters="/qa/lib/jest-reporter.js" ${args} .PHONY: test- From 918e08197e59ecad63d957b2fc6223d750f120c3 Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:51:00 -0600 Subject: [PATCH 4/7] wip --- packages/browser/Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/browser/Makefile b/packages/browser/Makefile index 47d7c7ece..acd85b9cf 100644 --- a/packages/browser/Makefile +++ b/packages/browser/Makefile @@ -5,10 +5,6 @@ help: ## Lists all available make tasks and some short documentation about them @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-24s\033[0m %s\n", $$1, $$2}' .PHONY: help - -## Basic repo maintenance - -# Installs npm dependencies node_modules: yarn install --immutable @touch $@ From 656341ed3ed56faa8be85f7aa78333b2577a69c7 Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:54:20 -0600 Subject: [PATCH 5/7] wip --- .buildkite/pipeline.yml | 2 +- packages/browser/Makefile | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 6952dc4b3..1b2c9042e 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -39,7 +39,7 @@ steps: commands: - npm config set "//registry.npmjs.org/:_authToken" $${NPM_TOKEN} - echo "--- Install dependencies" - - yarn install --immutable + - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 yarn install --immutable - echo "--- Build bundles" - yarn run -T browser . build - echo '--- Check Size limit' diff --git a/packages/browser/Makefile b/packages/browser/Makefile index acd85b9cf..6843b5c65 100644 --- a/packages/browser/Makefile +++ b/packages/browser/Makefile @@ -21,19 +21,19 @@ test-unit: node_modules ## Runs unit tests $(yarn_run) test .PHONY: test-unit -test-qa: build +test-qa: build COVERAGE=false $(yarn_run) test --runTestsByPath qa/__tests__/*.test.ts --testPathIgnorePatterns qa/__tests__/destinations.test.ts --reporters="default" --reporters="/qa/lib/jest-reporter.js" ${args} .PHONY: test-qa -test-qa-destinations: build +test-qa-destinations: build COVERAGE=false $(yarn_run) test --forceExit --runTestsByPath qa/__tests__/destinations.test.ts --reporters="default" --reporters="/qa/lib/jest-reporter.js" ${args} .PHONY: test- -test-integration: build +test-integration: build COVERAGE=false $(yarn_run) test --forceExit --runTestsByPath e2e-tests/**/*.test.ts ${args} .PHONY: test-integration -test-perf: build +test-perf: build $(yarn_run) test --forceExit --runTestsByPath e2e-tests/performance/*.test.ts ${args} .PHONY: test-perf From a62d3971364cc20a0bc6e363920d55045ec4757a Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:54:56 -0600 Subject: [PATCH 6/7] wip --- .buildkite/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 1b2c9042e..69b58b9ca 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -42,8 +42,6 @@ steps: - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 yarn install --immutable - echo "--- Build bundles" - yarn run -T browser . build - - echo '--- Check Size limit' - - yarn run -T browser size-limit - echo "+++ Run tests" - yarn run -T browser lint - yarn run -T browser test @@ -88,6 +86,8 @@ steps: - PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers yarn turbo run --filter=browser-integration-tests test - yarn run -T browser exec make test-integration - yarn run -T browser exec make test-perf + - echo '+++ Check Size limit' + - yarn run -T browser size-limit retry: automatic: - exit_status: '*' From 9114c5f6bb280dcfbb34c8611cefabb878d09a4f Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:55:14 -0600 Subject: [PATCH 7/7] wip --- .buildkite/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 69b58b9ca..af16df3a6 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -82,12 +82,12 @@ steps: - echo "--- Install dependencies" - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 yarn install --immutable - PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npx playwright install + - echo '+++ Check Size limit' + - yarn run -T browser size-limit - echo "+++ Run Browser integration tests :pray:" - PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers yarn turbo run --filter=browser-integration-tests test - yarn run -T browser exec make test-integration - yarn run -T browser exec make test-perf - - echo '+++ Check Size limit' - - yarn run -T browser size-limit retry: automatic: - exit_status: '*'