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

test: add commands to run all test suite on InstantSearch #13

Merged
merged 5 commits into from
Jan 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
aliases:
- &install_yarn_version
name: Install specific Yarn version
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0
echo 'export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"' >> $BASH_ENV

- &restore_yarn_cache
name: Restore Yarn cache
keys:
- yarn-{{ .Branch }}-packages-{{ checksum "yarn.lock" }}

- &save_yarn_cache
name: Save Yarn cache
key: yarn-{{ .Branch }}-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn

- &run_yarn_install
name: Install dependencies
command: yarn install

defaults: &defaults
working_directory: ~/instantsearch-e2-tests
docker:
- image: circleci/node:10.16.3@sha256:6ab62742cec4a68e75e7cac063f6549bae0bcfd0541700df7fde54765eed4ad2

version: 2
jobs:
test:
<<: *defaults
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: Test specs
command: yarn test:saucelabs

workflows:
version: 2
ci:
jobs:
- test
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
tests/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules/
npm-debug.log
yarn-error.log
.DS_Store
tests/*
!tests/*.sh
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"scripts": {
"commit": "git-cz",
"version": "conventional-changelog --preset angular --infile CHANGELOG.md --same-file && git add CHANGELOG.md",
"test": "yarn test:local",
"test:local": "yarn link && cd tests && ./instantsearch.js.sh && ./react-instantsearch.sh && ./vue-instantsearch.sh",
"test:saucelabs": "SAUCELABS=1 yarn test:local",
"lint": "eslint --ext .js,.ts,.tsx .",
"lint:fix": "eslint --ext .js,.ts,.tsx --fix .",
"type-check": "tsc",
Expand Down
15 changes: 15 additions & 0 deletions tests/instantsearch.js.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -e

rm -rf instantsearch.js
git clone [email protected]:algolia/instantsearch.js.git --branch develop --depth=1
cd instantsearch.js
yarn --ignore-engines
yarn link instantsearch-e2e-tests
yarn run website:build
if [ "$SAUCELABS" ]; then
yarn run test:e2e:saucelabs
else
yarn run test:e2e
fi
15 changes: 15 additions & 0 deletions tests/react-instantsearch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -e

rm -rf react-instantsearch
git clone [email protected]:algolia/react-instantsearch.git --branch master --depth=1
cd react-instantsearch
yarn --ignore-engines
yarn link instantsearch-e2e-tests
yarn run website:build
if [ "$SAUCELABS" ]; then
yarn run test:e2e:saucelabs
else
yarn run test:e2e
fi
15 changes: 15 additions & 0 deletions tests/vue-instantsearch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -e

rm -rf vue-instantsearch
git clone [email protected]:algolia/vue-instantsearch.git --branch master --depth=1
cd vue-instantsearch
yarn --ignore-engines
yarn link instantsearch-e2e-tests
yarn run examples:build
if [ "$SAUCELABS" ]; then
yarn run test:e2e:saucelabs
else
yarn run test:e2e
fi
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"types": ["node", "webdriverio", "jasmine"]
}
},
"exclude": ["node_modules", "tests"]
}