Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Commit

Permalink
build: e2e integration with puppeteer (#192)
Browse files Browse the repository at this point in the history
* build: add e2e testing scripts

* build: add e2e testing scripts

* chore: fix script

* chore: fix script

* chore: ignore e2e normal test

* chore: fix node_latest_browser

* chore: move lint to prepare

* chore: fix lint

* chore: add local theme

* fix: e2e tests
  • Loading branch information
juanpicado authored Oct 13, 2019
1 parent 0c4fb7d commit d1b3e6e
Show file tree
Hide file tree
Showing 19 changed files with 1,329 additions and 143 deletions.
36 changes: 21 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ aliases:
~/ui-theme
- &defaults
working_directory: *repo_path
- &node_latest_browser
docker:
- image: circleci/node:latest-browsers
- &node_latest_executor
docker:
- image: circleci/node:latest
Expand Down Expand Up @@ -47,9 +50,12 @@ jobs:
- run:
name: Install dependencies
command: yarn install --frozen-lockfile
- run:
name: Lint code
command: yarn lint
- run:
name: Build project
command: yarn run build
command: yarn build
- save_cache:
key: *yarn_cache_key
paths:
Expand All @@ -61,15 +67,6 @@ jobs:
paths:
- ./*

lint:
<<: *defaults
<<: *default_executor
steps:
- *restore_repo
- run:
name: Lint code
command: yarn lint

test_bundlesize:
<<: *defaults
<<: *default_executor
Expand All @@ -92,6 +89,15 @@ jobs:
paths:
- coverage

test_e2e:
<<: *defaults
<<: *node_latest_browser
steps:
- *restore_repo
- run:
name: Test E2E Node (LTS)
command: yarn test:e2e

test_node_lts:
<<: *defaults
<<: *node_lts_executor
Expand Down Expand Up @@ -138,10 +144,6 @@ workflows:
jobs:
- prepare:
<<: *ignore_non_dev_branches
- lint:
requires:
- prepare
<<: *ignore_non_dev_branches
- test_bundlesize:
requires:
- prepare
Expand All @@ -154,15 +156,19 @@ workflows:
requires:
- prepare
<<: *ignore_non_dev_branches
- test_e2e:
requires:
- prepare
<<: *ignore_non_dev_branches
- coverage:
requires:
- test_node_latest
<<: *ignore_non_dev_branches
- publish_package:
requires:
- lint
- test_bundlesize
- test_node_latest
- test_node_lts
- test_e2e
- coverage
<<: *execute_on_release
10 changes: 9 additions & 1 deletion jest/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ module.exports = {
rootDir: '..',
setupFiles: ['<rootDir>/jest/setup.ts'],
transformIgnorePatterns: ['<rootDir>/node_modules/(?!react-syntax-highlighter)'],
modulePathIgnorePatterns: ['<rootDir>/coverage', '<rootDir>/scripts', '<rootDir>/.circleci', '<rootDir>/tools', '<rootDir>/build', '<rootDir>/.vscode/'],
modulePathIgnorePatterns: [
'<rootDir>/coverage',
'<rootDir>/scripts',
'<rootDir>/.circleci',
'<rootDir>/tools',
'<rootDir>/build',
'<rootDir>/.vscode/',
'<rootDir>/test/e2e/',
],
snapshotSerializers: ['enzyme-to-json/serializer', 'jest-emotion'],
moduleNameMapper: {
'\\.(s?css)$': '<rootDir>/node_modules/identity-obj-proxy',
Expand Down
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
"@types/react": "16.9.2",
"@types/react-dom": "16.9.0",
"@types/react-router-dom": "5.1.0",
"@types/request": "2.48.3",
"@types/validator": "10.11.3",
"@types/webpack-env": "1.14.0",
"@typescript-eslint/parser": "2.3.2",
"@verdaccio/babel-preset": "2.0.0",
"@verdaccio/commons-api": "8.1.2",
"@verdaccio/eslint-config": "2.0.0",
"@verdaccio/types": "8.1.0",
"autosuggest-highlight": "3.1.1",
Expand Down Expand Up @@ -82,13 +84,14 @@
"ora": "3.4.0",
"prettier": "1.18.2",
"prop-types": "15.7.2",
"puppeteer": "1.17.0",
"puppeteer": "1.8.0",
"react": "16.10.0",
"react-autosuggest": "9.4.3",
"react-dom": "16.10.0",
"react-emotion": "9.2.12",
"react-hot-loader": "4.12.11",
"react-router-dom": "5.1.2",
"request": "2.88.0",
"resolve-url-loader": "3.1.0",
"rimraf": "3.0.0",
"source-map-loader": "0.2.4",
Expand All @@ -105,9 +108,10 @@
"uglifyjs-webpack-plugin": "2.2.0",
"url-loader": "2.1.0",
"validator": "11.1.0",
"verdaccio": "4.2.2",
"verdaccio-auth-memory": "8.1.1",
"verdaccio-memory": "8.1.1",
"verdaccio": "4.3.3",
"verdaccio-auth-memory": "8.1.2",
"verdaccio-memory": "8.1.2",
"wait-on": "3.3.0",
"webpack": "4.41.0",
"webpack-bundle-analyzer": "3.5.2",
"webpack-bundle-size-analyzer": "3.1.0",
Expand Down Expand Up @@ -156,6 +160,7 @@
"test:clean": "npx jest --clearCache",
"test:acceptance": "codeceptjs run --steps",
"test:acceptance:server": "concurrently --kill-others \"npm run verdaccio:server\" \"npm run test:acceptance\"",
"test:e2e": "cross-env BABEL_ENV=test jest --config ./test/jest.config.e2e.js",
"test": "cross-env NODE_ENV=test BABEL_ENV=test TZ=UTC jest --config ./jest/jest.config.js --maxWorkers 2 --passWithNoTests",
"test:size": "bundlesize",
"lint": "npm run lint:js && npm run lint:css && npm run lint:lockfile",
Expand Down
11 changes: 11 additions & 0 deletions test/e2e/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"rules": {
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-member-accessibility": 0,
"no-console": 0,
"new-cap": 0,
"max-len": 0
}
}
31 changes: 31 additions & 0 deletions test/e2e/config/config-protected-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
web:
enable: true
title: verdaccio-server-protected-e2e

store:
memory:
limit: 10

auth:
auth-memory:
users:
test:
name: test
password: test

logs:
- { type: stdout, format: pretty, level: warn }

packages:
'protected-*':
access: $authenticated
publish: $authenticated

theme:
../plugins/theme:
prop: dummy

listen: 0.0.0.0:55552

# expose internal methods
_debug: true
34 changes: 34 additions & 0 deletions test/e2e/config/config-scoped-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
web:
enable: true
title: verdaccio-server-e2e

store:
memory:
limit: 10

auth:
auth-memory:
users:
test:
name: test
password: test

logs:
- { type: stdout, format: pretty, level: warn }

packages:
'@*/*':
access: $all
publish: $all
'**':
access: $all
publish: $authenticated

theme:
../plugins/theme:
prop: dummy

listen: 0.0.0.0:55558

# expose internal methods
_debug: true
Loading

0 comments on commit d1b3e6e

Please sign in to comment.