From 3f6452bdf548174f9efb7db651c93c575357768e Mon Sep 17 00:00:00 2001 From: M-ZubairAhmed Date: Tue, 4 Apr 2023 00:59:04 +0530 Subject: [PATCH] init (#22752) --- webapp/channels/.eslintignore | 1 - webapp/channels/.eslintrc.json | 16 +---------- webapp/channels/.gobom.json | 1 - webapp/channels/Makefile | 52 ---------------------------------- webapp/channels/jest.config.js | 3 +- webapp/channels/package.json | 1 - webapp/channels/tsconfig.json | 2 -- webapp/package-lock.json | 23 --------------- 8 files changed, 2 insertions(+), 97 deletions(-) diff --git a/webapp/channels/.eslintignore b/webapp/channels/.eslintignore index 9c3001349d..468bb89127 100644 --- a/webapp/channels/.eslintignore +++ b/webapp/channels/.eslintignore @@ -1,4 +1,3 @@ -e2e/results node_modules dist lib diff --git a/webapp/channels/.eslintrc.json b/webapp/channels/.eslintrc.json index 048bb4b85e..7a3865a6db 100644 --- a/webapp/channels/.eslintrc.json +++ b/webapp/channels/.eslintrc.json @@ -2,22 +2,19 @@ "root": true, "extends": [ "plugin:mattermost/react", - "plugin:cypress/recommended", "plugin:react-hooks/recommended" ], "plugins": [ "@babel/eslint-plugin", "mattermost", "import", - "cypress", "no-only-tests", "@typescript-eslint", "formatjs" ], "parser": "@typescript-eslint/parser", "env": { - "jest": true, - "cypress/globals": true + "jest": true }, "settings": { "import/resolver": "webpack", @@ -166,17 +163,6 @@ "no-process-env": 0, "prefer-arrow-callback": 0 } - }, - { - "files": ["e2e/**"], - "rules": { - "@babel/no-unused-expressions": 0, - "func-names": 0, - "import/no-unresolved": 0, - "max-nested-callbacks": 0, - "no-process-env": 0, - "no-unused-expressions": 0 - } } ] } diff --git a/webapp/channels/.gobom.json b/webapp/channels/.gobom.json index 3279174525..4ec47b22c6 100644 --- a/webapp/channels/.gobom.json +++ b/webapp/channels/.gobom.json @@ -3,7 +3,6 @@ "properties": { "GomodMainOnly": true, "GomodExcludes": "_tests/|[-_]generators?$|^plugin/checker$", - "NpmExcludes": "/e2e$", "GradlePath": "./gradlew:../gradlew" }, "filters": [ diff --git a/webapp/channels/Makefile b/webapp/channels/Makefile index 889907e624..aa20ad2ca2 100644 --- a/webapp/channels/Makefile +++ b/webapp/channels/Makefile @@ -6,58 +6,6 @@ export NODE_OPTIONS=--max-old-space-size=4096 i18n-extract: ## Extract strings for translation from the source code npm run i18n-extract -e2e/playwright/node_modules: - @echo Install Playwright and its dependencies - cd e2e/playwright && npm install - -.PHONY: e2e-test -e2e-test: - @echo E2E: Running mattermost-mysql-e2e - @if [ $(shell docker ps -a | grep -ci mattermost-mysql-e2e) -eq 0 ]; then \ - echo starting mattermost-mysql-e2e; \ - docker run --name mattermost-mysql-e2e -p 35476:3306 -e MYSQL_ROOT_PASSWORD=mostest \ - -e MYSQL_USER=mmuser -e MYSQL_PASSWORD=mostest -e MYSQL_DATABASE=mattermost_test -d mysql:5.7 > /dev/null; \ - elif [ $(shell docker ps | grep -ci mattermost-mysql-e2e) -eq 0 ]; then \ - echo restarting mattermost-mysql-e2e; \ - docker start mattermost-mysql-e2e > /dev/null; \ - fi - - cd $(BUILD_SERVER_DIR) && [[ -f config/config.json ]] && \ - cp config/config.json config/config-backup.json && make config-reset || \ - echo "config.json not found" && make config-reset - - @echo E2E: Starting the server - cd $(BUILD_SERVER_DIR) && $(MAKE) run - - @echo E2E: Generating test data - cd $(BUILD_SERVER_DIR) && $(MAKE) test-data - - @echo E2E: Running end-to-end testing - cd e2e && npm install && npm run cypress:run - - @echo E2E: Stoppping the server - cd $(BUILD_SERVER_DIR) && $(MAKE) stop - - @echo E2E: stopping mattermost-mysql-e2e - docker stop mattermost-mysql-e2e > /dev/null - - cd $(BUILD_SERVER_DIR) && [[ -f config/config-backup.json ]] && \ - cp config/config-backup.json config/config.json && echo "revert local config.json" || \ - echo "config-backup.json not found" && sed -i'' -e 's|"DataSource": ".*"|"DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s"|g' config/config.json - - @echo E2E: Tests completed - -.PHONY: clean-e2e -clean-e2e: - @if [ $(shell docker ps -a | grep -ci mattermost-mysql-e2e) -eq 1 ]; then \ - echo stopping mattermost-mysql-e2e; \ - docker stop mattermost-mysql-e2e > /dev/null; \ - fi - - cd $(BUILD_SERVER_DIR) && [[ -f config/config-backup.json ]] && \ - cp config/config-backup.json config/config.json && echo "revert local config.json" || \ - echo "config-backup.json not found" && sed -i'' -e 's|"DataSource": ".*"|"DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s"|g' config/config.json - .PHONY: emojis emojis: ## Creates emoji JSON, JSX and Go files and extracts emoji images from the system font SERVER_DIR=$(BUILD_SERVER_DIR) npm run make-emojis diff --git a/webapp/channels/jest.config.js b/webapp/channels/jest.config.js index 123f6d7e57..01d80ffe8d 100644 --- a/webapp/channels/jest.config.js +++ b/webapp/channels/jest.config.js @@ -5,7 +5,7 @@ const config = { snapshotSerializers: ['enzyme-to-json/serializer'], - testPathIgnorePatterns: ['/node_modules/', '/e2e/'], + testPathIgnorePatterns: ['/node_modules/'], clearMocks: true, collectCoverageFrom: [ 'actions/src/**/*.{js,jsx,ts,tsx}', @@ -17,7 +17,6 @@ const config = { 'selectors/src/**/*.{js,jsx,ts,tsx}', 'stores/src/**/*.{js,jsx,ts,tsx}', 'utils/src/**/*.{js,jsx,ts,tsx}', - '!e2e/**', ], coverageReporters: ['lcov', 'text-summary'], moduleNameMapper: { diff --git a/webapp/channels/package.json b/webapp/channels/package.json index 7f33c6b05f..830cbfae08 100644 --- a/webapp/channels/package.json +++ b/webapp/channels/package.json @@ -169,7 +169,6 @@ "enzyme-to-json": "3.6.2", "eslint": "7.32.0", "eslint-import-resolver-webpack": "0.13.2", - "eslint-plugin-cypress": "2.11.3", "eslint-plugin-formatjs": "4.3.4", "eslint-plugin-header": "3.1.1", "eslint-plugin-import": "2.23.4", diff --git a/webapp/channels/tsconfig.json b/webapp/channels/tsconfig.json index f71364fdc0..85f5958590 100644 --- a/webapp/channels/tsconfig.json +++ b/webapp/channels/tsconfig.json @@ -28,8 +28,6 @@ "reselect": ["packages/reselect/src"], "@mui/styled-engine": ["./node_modules/@mui/styled-engine-sc"], "!!file-loader*": ["utils/empty-string"], - "@e2e-support/*": ["e2e/playwright/support/*"], - "@e2e-test.config": ["e2e/playwright/test.config.ts"] } }, "include": [ diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 923fdfd0e4..987b8de866 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -3905,7 +3905,6 @@ "enzyme-to-json": "3.6.2", "eslint": "7.32.0", "eslint-import-resolver-webpack": "0.13.2", - "eslint-plugin-cypress": "2.11.3", "eslint-plugin-formatjs": "4.3.4", "eslint-plugin-header": "3.1.1", "eslint-plugin-import": "2.23.4", @@ -17819,18 +17818,6 @@ "eslint": ">=4.0.0" } }, - "node_modules/eslint-plugin-cypress": { - "version": "2.11.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.11.3.tgz", - "integrity": "sha512-hOoAid+XNFtpvOzZSNWP5LDrQBEJwbZwjib4XJ1KcRYKjeVj0mAmPmucG4Egli4j/aruv+Ow/acacoloWWCl9Q==", - "dev": true, - "dependencies": { - "globals": "^11.12.0" - }, - "peerDependencies": { - "eslint": ">= 3.2.1" - } - }, "node_modules/eslint-plugin-formatjs": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/eslint-plugin-formatjs/-/eslint-plugin-formatjs-4.3.4.tgz", @@ -50096,15 +50083,6 @@ "eslint-rule-composer": "^0.3.0" } }, - "eslint-plugin-cypress": { - "version": "2.11.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.11.3.tgz", - "integrity": "sha512-hOoAid+XNFtpvOzZSNWP5LDrQBEJwbZwjib4XJ1KcRYKjeVj0mAmPmucG4Egli4j/aruv+Ow/acacoloWWCl9Q==", - "dev": true, - "requires": { - "globals": "^11.12.0" - } - }, "eslint-plugin-formatjs": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/eslint-plugin-formatjs/-/eslint-plugin-formatjs-4.3.4.tgz", @@ -55129,7 +55107,6 @@ "enzyme-to-json": "3.6.2", "eslint": "7.32.0", "eslint-import-resolver-webpack": "0.13.2", - "eslint-plugin-cypress": "2.11.3", "eslint-plugin-formatjs": "4.3.4", "eslint-plugin-header": "3.1.1", "eslint-plugin-import": "2.23.4",