diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index f5acdb609..af16df3a6 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -39,8 +39,12 @@ steps: commands: - npm config set "//registry.npmjs.org/:_authToken" $${NPM_TOKEN} - echo "--- Install dependencies" - - yarn install --immutable - - yarn run -T browser exec make ci + - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 yarn install --immutable + - echo "--- Build bundles" + - yarn run -T browser . build + - 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' }}" @@ -78,8 +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 retry: automatic: - exit_status: '*' @@ -88,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' @@ -162,25 +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 - 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: diff --git a/packages/browser/Makefile b/packages/browser/Makefile index af62a83d3..6843b5c65 100644 --- a/packages/browser/Makefile +++ b/packages/browser/Makefile @@ -5,18 +5,10 @@ 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 $@ -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,29 +17,23 @@ 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 ## Runs all QA tests in a single command +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 ## Runs Destination QA tests. options. DESTINATION=amplitude DEBUG=true +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-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 +41,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