Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: setup for real-world performance testing (#458)
- Loading branch information
1 parent
8141f01
commit 15191bb
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Temp README (intended for maintainers only at this time) | ||
|
||
Run: | ||
|
||
```sh | ||
docker-compose -f tests/performance/docker-compose.yml up --build | ||
``` | ||
|
||
It will build the docker container, create volumes for the local files, and will clone the real world project repo ready for experimentation. | ||
|
||
The docker container is configured to run forever, so you just need to attach a shell to it, | ||
|
||
e.g. by running | ||
|
||
```sh | ||
docker exec -it {{ RUNNING_CONTAINER_ID_HERE }} bash | ||
``` | ||
|
||
Or by using the docker extension in VSCode and right clicking on the running container. | ||
|
||
Every time you make an update to the local built packages (e.g. parser or eslint-plugin), you need to rerun | ||
the utility script _within_ the running container. | ||
|
||
For example, you will run something like the following (where `root@a91d93f9ffc3` refers to what's running in your container): | ||
|
||
```sh | ||
root@a91d93f9ffc3:/usr/vega-lite# ../linked/install-local-packages.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: '3' | ||
|
||
services: | ||
lint-real-repo: | ||
build: ./fixtures/lint-real-repo | ||
container_name: "lint-real-repo" | ||
volumes: | ||
# Runtime link to the relevant built @typescript-eslint packages and test utils, | ||
# but apply an empty volume for the package tests, we don't need those. | ||
- ../../package.json/:/usr/root-package.json | ||
- ./utils/:/usr/utils | ||
- ../../packages/parser/:/usr/parser | ||
- /usr/parser/tests | ||
- ../../packages/typescript-estree/:/usr/typescript-estree | ||
- /usr/typescript-estree/tests | ||
- ../../packages/eslint-plugin/:/usr/eslint-plugin | ||
- /usr/eslint-plugin/tests | ||
- ../../packages/eslint-plugin-tslint/:/usr/eslint-plugin-tslint | ||
- /usr/eslint-plugin-tslint/tests | ||
# Runtime link to all the specific integration test files, so that most updates don't require a rebuild. | ||
- ./fixtures/lint-real-repo:/usr/linked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:carbon | ||
|
||
WORKDIR /usr | ||
|
||
# Clone the repo and checkout the relevant commit | ||
RUN git clone https://github.com/typescript-eslint/vega-lite | ||
WORKDIR /usr/vega-lite | ||
RUN git checkout f1e4c1ebe50fdf3b9131ba5dde915e6efbe4bd87 | ||
|
||
# Run the equivalent of the project's travis build before linting starts | ||
RUN yarn install --frozen-lockfile && yarn cache clean | ||
RUN yarn build | ||
|
||
# Keep the container alive forever | ||
CMD [ "tail", "-f", "/dev/null"] |
10 changes: 10 additions & 0 deletions
10
tests/performance/fixtures/lint-real-repo/install-local-packages.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This script should be run by attaching a shell to the running docker | ||
# container, and then running `../linked/install-local-packages.sh` from | ||
# that shell. | ||
# | ||
# Use the local volumes for our own packages | ||
# NOTE: You need to rerun this script every time the local packages change | ||
# in order to apply the changes to the node_modules of the repo under test | ||
yarn add @typescript-eslint/typescript-estree@file:///usr/typescript-estree | ||
yarn add @typescript-eslint/parser@file:///usr/parser | ||
yarn add @typescript-eslint/eslint-plugin@file:///usr/eslint-plugin |