Skip to content

test: setup for real-world performance testing #458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2019
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
28 changes: 28 additions & 0 deletions tests/performance/README.md
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
```
21 changes: 21 additions & 0 deletions tests/performance/docker-compose.yml
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
15 changes: 15 additions & 0 deletions tests/performance/fixtures/lint-real-repo/Dockerfile
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"]
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