├── .circleci └── config.yml ├── .editorconfig ├── .gitmodules ├── README.md ├── local-test.sh └── pack-vue.sh /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | anchors: 4 | container_config: &container_config 5 | docker: 6 | - image: circleci/node:10-browsers 7 | 8 | workspace_root: &workspace_root 9 | ~/workspace 10 | 11 | attach_workspace: &attach_workspace 12 | attach_workspace: 13 | at: *workspace_root 14 | 15 | restore_yarn_cache: &restore_yarn_cache 16 | restore_cache: 17 | keys: 18 | - yarn-packages-{{ checksum "yarn.lock" }} 19 | 20 | yarn_install: &yarn_install 21 | run: yarn install --pure-lockfile --non-interactive 22 | 23 | save_yarn_cache: &save_yarn_cache 24 | save_cache: 25 | paths: 26 | - ~/.cache/yarn 27 | - node_modules 28 | key: yarn-packages-{{ checksum "yarn.lock" }} 29 | 30 | install_from_submodule: &install_from_submodule 31 | run: | 32 | yarn add -W ../vue/vue-v*.tgz \ 33 | ../vue/packages/vue-server-renderer/vue-server-renderer-v*.tgz \ 34 | ../vue/packages/vue-template-compiler/vue-template-compiler-v*.tgz 35 | # need to run twice to force install in many cases, don't know why yet 36 | yarn add -W ../vue/vue-v*.tgz \ 37 | ../vue/packages/vue-server-renderer/vue-server-renderer-v*.tgz \ 38 | ../vue/packages/vue-template-compiler/vue-template-compiler-v*.tgz 39 | 40 | run_element_test: &run_element_test 41 | 42 | run_nuxt_test: &run_nuxt_test 43 | 44 | run_vuetify_test: &run_vuetify_test 45 | 46 | jobs: 47 | update: 48 | <<: *container_config 49 | working_directory: ~/repo 50 | steps: 51 | - checkout 52 | - run: 53 | name: init 54 | command: | 55 | git submodule sync 56 | git submodule update --init 57 | - run: 58 | name: update submodule 59 | command: | 60 | git config --global user.email "${GITHUB_EMAIL}" 61 | git config --global user.name "Vue Regression Bot" 62 | 63 | git submodule update --remote vue 64 | cd vue && git checkout $VUE_REVISION 65 | cd ../ 66 | 67 | # if VUE_REVISION has not changed since last update, 68 | # git push will exit with code 1 and test will fail 69 | git commit -am 'update vue from circleci' || test 1 = 1 70 | git push || test 1 = 1 71 | 72 | build_vue: 73 | <<: *container_config 74 | working_directory: ~/repo/vue 75 | steps: 76 | - checkout: 77 | path: ~/repo 78 | 79 | - run: 80 | name: init 81 | command: | 82 | git submodule sync 83 | git submodule update --init 84 | 85 | - *restore_yarn_cache 86 | - *yarn_install 87 | - *save_yarn_cache 88 | 89 | - run: yarn build 90 | - run: ../pack-vue.sh 91 | 92 | - run: | 93 | mkdir -p ~/workspace 94 | mv ~/repo/ ~/workspace/repo 95 | 96 | - persist_to_workspace: 97 | root: ~/workspace 98 | paths: 99 | - repo 100 | 101 | vue-router: 102 | <<: *container_config 103 | working_directory: ~/workspace/repo/vue-router 104 | steps: 105 | - *attach_workspace 106 | - *restore_yarn_cache 107 | - *yarn_install 108 | - *save_yarn_cache 109 | - *install_from_submodule 110 | - run: yarn test 111 | 112 | vuex: 113 | <<: *container_config 114 | working_directory: ~/workspace/repo/vuex 115 | steps: 116 | - *attach_workspace 117 | - *restore_yarn_cache 118 | - *yarn_install 119 | - *save_yarn_cache 120 | - *install_from_submodule 121 | - run: yarn test 122 | 123 | element: 124 | <<: *container_config 125 | working_directory: ~/workspace/repo/element 126 | steps: 127 | - *attach_workspace 128 | - *restore_yarn_cache 129 | - *yarn_install 130 | - *save_yarn_cache 131 | - *install_from_submodule 132 | - run: sed -ie "s/it('keyboard event'/it.skip('keyboard event'/g" test/unit/specs/radio.spec.js 133 | - run: yarn test 134 | 135 | nuxt.js: 136 | <<: *container_config 137 | working_directory: ~/workspace/repo/nuxt.js 138 | environment: 139 | NODE_ENV: test 140 | NODE_OPTIONS: --max_old_space_size=4096 141 | steps: 142 | - *attach_workspace 143 | - *restore_yarn_cache 144 | - *yarn_install 145 | - *save_yarn_cache 146 | - *install_from_submodule 147 | - run: yarn test:fixtures -i 148 | - run: yarn test:unit -w=2 149 | - run: 150 | name: Download Chromium 151 | command: | 152 | cd /opt 153 | sudo wget https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/641430/chrome-linux.zip 154 | sudo unzip chrome-linux.zip 155 | sudo ln -s `pwd`/chrome-linux/chrome /bin/chromium 156 | - run: CHROME_PATH=/bin/chromium yarn test:e2e 157 | 158 | vuetify: 159 | <<: *container_config 160 | working_directory: ~/workspace/repo/vuetify 161 | steps: 162 | - *attach_workspace 163 | - *restore_yarn_cache 164 | - *yarn_install 165 | - *save_yarn_cache 166 | - *install_from_submodule 167 | - run: npx lerna run test:coverage -- -i 168 | 169 | workflows: 170 | version: 2 171 | 172 | test_all: 173 | jobs: 174 | - build_vue 175 | - vue-router: 176 | requires: 177 | - build_vue 178 | - vuex: 179 | requires: 180 | - build_vue 181 | - element: 182 | requires: 183 | - build_vue 184 | # - nuxt.js: 185 | # requires: 186 | # - build_vue 187 | # - vuetify: 188 | # requires: 189 | # - build_vue 190 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 2 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | insert_final_newline = false 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "element"] 2 | path = element 3 | url = https://github.com/ElemeFE/element.git 4 | [submodule "vuetify"] 5 | path = vuetify 6 | url = https://github.com/vuetifyjs/vuetify.git 7 | [submodule "nuxt.js"] 8 | path = nuxt.js 9 | url = https://github.com/nuxt/nuxt.js.git 10 | [submodule "vue"] 11 | path = vue 12 | url = https://github.com/vuejs/vue.git 13 | [submodule "vue-router"] 14 | path = vue-router 15 | url = https://github.com/vuejs/vue-router.git 16 | [submodule "vuex"] 17 | path = vuex 18 | url = https://github.com/vuejs/vuex.git 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vue.js Regression Test 2 | 3 | Regression test for popular libraries in Vue.js ecosystem. 4 | 5 | Run periodically against Vue.js `dev` branch. 6 | Can also be manually triggered by pushing to Vue.js `regression-test` branch. 7 | 8 | ## Build & Run 9 | 10 | Since we use CircleCI workflows to speed up tests for multiple libraries, it is not impossible to run them locally. 11 | 12 | ## Included Libraries 13 | 14 | - [element-ui](https://github.com/ElemeFE/element) 15 | - [nuxt](https://github.com/nuxt/nuxt.js) 16 | - [vuetify](https://github.com/vuetifyjs/vuetify/) 17 | 18 | ## How to Add/Update Third Party Libraries 19 | 20 | ### Requirements for Including Libraries 21 | 22 | - Significant user base 23 | - No failing tests for currently Vue.js stable release 24 | - No random failing tests 25 | 26 | ### To Add a New Library 27 | 28 | Adding a new library requires the following steps: 29 | 30 | - Add git submodule (point to the latest stable release tag) 31 | - Config test job for CircleCI 32 | - Take the `vuetify` job as a reference 33 | - If tests are run by `jest`, add `--maxWorkers 2` to `jest` argument list (otherwise it will cause memory issues on CircleCI) 34 | - Add test job to `test_all` workflow 35 | 36 | ### To Update an Existing Library 37 | 38 | Third-party libraies should be updated manually. 39 | The basic idea is to update libraries to their latest **stable** releases. 40 | Release tags are listed on their corresponding GitHub Releases pages. 41 | 42 | ```bash 43 | git submodule update --remote 44 | cd 45 | git checkout 46 | cd .. 47 | git add 48 | git commit -m 'chore: update library version' 49 | git push 50 | ``` 51 | 52 | ## To Run Tests Locally 53 | 54 | To run the regression tests locally against a specific commit in the [vue](https://github.com/vuejs/vue) repository 55 | 56 | ```bash 57 | ./local-test.sh [COMMIT_HASH_OR_BRANCH_NAME] 58 | ``` 59 | -------------------------------------------------------------------------------- /local-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd vue 3 | git checkout -- . 4 | cd .. 5 | 6 | git submodule sync 7 | git submodule update --init 8 | 9 | cd vue 10 | if [ "$1" ] 11 | then 12 | echo "Checking out $1" 13 | 14 | git fetch 15 | git checkout $1 16 | else 17 | echo "No commit hash or branch specified, testing with commit $(git rev-parse --short HEAD)" 18 | fi 19 | yarn install --pure-lockfile 20 | yarn build 21 | ../pack-vue.sh 22 | 23 | installDeps() { 24 | yarn install --frozen-lockfile --non-interactive 25 | } 26 | 27 | installLocalVue() { 28 | yarn add -W ../vue/vue-v*.tgz \ 29 | ../vue/packages/vue-server-renderer/vue-server-renderer-v*.tgz \ 30 | ../vue/packages/vue-template-compiler/vue-template-compiler-v*.tgz 31 | 32 | # need to run twice to force install in many cases, don't know why yet 33 | yarn add -W ../vue/vue-v*.tgz \ 34 | ../vue/packages/vue-server-renderer/vue-server-renderer-v*.tgz \ 35 | ../vue/packages/vue-template-compiler/vue-template-compiler-v*.tgz 36 | } 37 | 38 | cleanup() { 39 | git checkout -- . 40 | rm -rf node_modules 41 | } 42 | 43 | cd ../vue-router 44 | echo -e "\n\nTesting vue-router…\n\n" 45 | installDeps 46 | installLocalVue 47 | yarn test 48 | cleanup 49 | 50 | cd ../vuex 51 | echo -e "\n\nTesting vuex…\n\n" 52 | installDeps 53 | installLocalVue 54 | yarn test 55 | cleanup 56 | 57 | cd ../element 58 | echo -e "\n\nTesting element…\n\n" 59 | read version _ <<< $(node --version) 60 | if [[ $version != *"v10."* ]]; then 61 | echo "Element requires Node.js v10, please switch your default Node.js version" 62 | exit 63 | fi 64 | installDeps 65 | installLocalVue 66 | yarn test 67 | cleanup 68 | 69 | cd ../nuxt.js 70 | echo -e "\n\nTesting nuxt.js…\n\n" 71 | installDeps 72 | installLocalVue 73 | rm ../test-nuxt.js.log 74 | NODE_ENV=test yarn test:fixtures -i 75 | NODE_ENV=test yarn test:unit -w=2 76 | NODE_ENV=test yarn test:e2e 77 | cleanup 78 | 79 | cd ../vuetify 80 | echo -e "\n\nTesting vuetify…\n\n" 81 | installDeps 82 | installLocalVue 83 | npx lerna run test:coverage -- -i 84 | cleanup 85 | 86 | echo -e "\n\nTest done" 87 | -------------------------------------------------------------------------------- /pack-vue.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | base_directory=$(cd "$(dirname "$0")/"; pwd) 3 | 4 | cd "${base_directory}/vue" 5 | yarn pack 6 | 7 | for dir in ${base_directory}/vue/packages/*/; do 8 | cd "${dir}" 9 | yarn pack 10 | done 11 | --------------------------------------------------------------------------------