Skip to content

Commit 34a05f1

Browse files
authored
Merge pull request #7 from michelle192837/update
Revert "Update dev guide and generated protos."
2 parents 9651187 + 1c36ab8 commit 34a05f1

File tree

6 files changed

+225
-520
lines changed

6 files changed

+225
-520
lines changed

web/README.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,12 @@ Testgrid frontend code uses Lit elements and is written in Typescript. `tsconfig
66
More info about Lit and Typescript can be found in [Lit docs](https://lit.dev/) and [TS docs](https://www.typescriptlang.org/) respectively.
77

88
## Development
9-
Local development is done with the help of [Web Dev Server](https://modern-web.dev/docs/dev-server/overview/). Web dev server configurations are defined in `web-dev-server-{env}.config.mjs` file. Depending on the config, frontend will render from the data from either fake or prod API.
9+
Local development is done with the help of [Web Dev Server](https://modern-web.dev/docs/dev-server/overview/). Web dev server configurations are defined in `web-dev-server-{env}.config.mjs` file. Depending on the config, frontend will render from the data from either fake or prod API.
1010

11-
To develop locally:
12-
- Run `npm install`, then:
13-
- To see fake data, run `npm run start:local`
14-
- To see prod data, run `npm run start:k8s`
15-
16-
More info in the [Scripts](#scripts) section below.
17-
18-
TIP: If you hit unexpected errors, try running `rm -rf node_modules/`, then `npm install` to refresh dependencies.
11+
To see fake data, run `npm run start:local`. To see prod data, run `npm run start:k8s`. More info in the [Scripts](#scripts) section below.
1912

2013
## Testing
14+
Testing relies on [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/) with the configuration defined in `web-test-runner.config.mjs`. Testing is currently happening across the fake data provided by `json-server`.
2115

2216
To run the tests, run `npm run test`. More info in the [Scripts](#scripts) section below.
2317

@@ -34,15 +28,7 @@ Most scripts are in `npm run` commands.
3428

3529
## Pulling from upstream
3630

37-
To generate or update the proto definitions:
38-
39-
- Checkout a local copy of https://github.com/GoogleCloudPlatform/testgrid, ex. `gh repo clone GoogleCloudPlatform/testgrid $HOME/gcp-testgrid`
40-
- Run
41-
```
42-
# Path to local GCP/testgrid repo, `$HOME/gcp-testgrid`
43-
TGREPO={{local GCP/testgrid repo}}
44-
bump-protos.sh "$TGREPO"
45-
```
31+
Upstream proto definitions can be generated by running `pb/bump-protos.sh`
4632

4733
## Configs and files
4834
- Frontend code is located in `src` dir.
@@ -52,4 +38,4 @@ To generate or update the proto definitions:
5238
- `tsconfig.json` defines how and where will the .ts files compile.
5339
- `web-dev-server-*.config.mjs` defines configuration parameters for the web dev server.
5440
- `web-test-runner.config.mjs` defined configuration parameters for the web test runner.
55-
- `rollup.config.js` defines how the code will be built and bundled.
41+
- `rollup.config.js` defines how the code will be built and bundled.

web/bump-protos.sh

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,16 @@ set -o errexit
1717
set -o nounset
1818
set -o pipefail
1919

20-
if [ "$#" -lt 1 ]
21-
then
22-
echo "Usage: $0 [path to local GCP/testgrid repo]"
23-
exit 1
24-
fi
25-
26-
# The location of your local https://github.com/GoogleCloudPlatform/testgrid repo, where the proto files live.
27-
TESTGRID_REPO=$1
28-
29-
WORKDIR="$(git rev-parse --show-toplevel)" # The root directory of your repository
20+
WORKDIR="${HOME}/github/testgrid" # The root directory of your repository
3021
PROTO_DEST="${WORKDIR}/web/src/gen"
3122

32-
echo "Generating protos from source $TESTGRID_REPO to destination $PROTO_DEST..."
33-
3423
cd "${WORKDIR}/web"
3524

3625
# See https://github.com/timostamm/protobuf-ts/blob/master/MANUAL.md
37-
npx protoc --ts_out ${PROTO_DEST} --proto_path ${TESTGRID_REPO} --ts_opt long_type_string \
38-
${TESTGRID_REPO}/pb/custom_evaluator/custom_evaluator.proto \
39-
${TESTGRID_REPO}/pb/state/state.proto \
40-
${TESTGRID_REPO}/pb/summary/summary.proto \
41-
${TESTGRID_REPO}/pb/config/config.proto \
42-
${TESTGRID_REPO}/pb/test_status/test_status.proto \
43-
${TESTGRID_REPO}/pb/api/v1/data.proto
26+
npx protoc --ts_out ${PROTO_DEST} --proto_path ${WORKDIR} --ts_opt long_type_string \
27+
${WORKDIR}/pb/custom_evaluator/custom_evaluator.proto \
28+
${WORKDIR}/pb/state/state.proto \
29+
${WORKDIR}/pb/summary/summary.proto \
30+
${WORKDIR}/pb/config/config.proto \
31+
${WORKDIR}/pb/test_status/test_status.proto \
32+
${WORKDIR}/pb/api/v1/data.proto

0 commit comments

Comments
 (0)