Skip to content

Commit 63ce7fe

Browse files
author
Ning Kang
committed
[BEAM-10775] Added nodejs installation and documentation
1. Added nodejs installation in scripts because Node.js is needed by jlpm. 2. Added documentation of the typescript job to pull request template and README.
1 parent aa345db commit 63ce7fe

File tree

6 files changed

+52
-4
lines changed

6 files changed

+52
-4
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ XLang | [![Build Status](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Dire
2424
Pre-Commit Tests Status (on master branch)
2525
------------------------------------------------------------------------------------------------
2626

27-
--- |Java | Python | Go | Website | Whitespace
28-
--- | --- | --- | --- | --- | ---
29-
Non-portable | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Cron/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Cron/lastCompletedBuild/) <br>[![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Go_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Go_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Cron/lastCompletedBuild/)
30-
Portable | --- | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/) | --- | --- | ---
27+
--- |Java | Python | Go | Website | Whitespace | Typescript
28+
--- | --- | --- | --- | --- | --- | ---
29+
Non-portable | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Cron/lastCompletedBuild/)<br>[![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Cron/lastCompletedBuild/) <br>[![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Go_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Go_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Cron/lastCompletedBuild/) | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Typescript_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Typescript_Cron/lastCompletedBuild/)
30+
Portable | --- | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/) | --- | --- | --- | ---
3131

3232
See [.test-infra/jenkins/README](https://github.com/apache/beam/blob/master/.test-infra/jenkins/README.md) for trigger phrase, status and link of all Jenkins jobs.
3333

.test-infra/jenkins/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Beam Jenkins overview page: [link](https://ci-beam.apache.org/)
4444
| beam_PreCommit_Website | [commit](https://ci-beam.apache.org/job/beam_PreCommit_Website_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_Website_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_Website_Phrase/) | `Run Website PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Website_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Website_Cron) |
4545
| beam_PreCommit_Website_Stage_GCS | [commit](https://ci-beam.apache.org/job/beam_PreCommit_Website_Stage_GCS_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_Website_Stage_GCS_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_Website_Stage_GCS_Phrase/) | `Run Website_Stage_GCS PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Website_Stage_GCS_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Website_Stage_GCS_Cron) |
4646
| beam_PreCommit_Whitespace | [commit](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Phrase/) | `Run Whitespace PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Cron) |
47+
| beam_PreCommit_Typescript | [commit](https://ci-beam.apache.org/job/beam_PreCommit_Typescript_Commit/), [cron](https://ci-beam.apache.org/job/beam_PreCommit_Typescript_Cron/), [phrase](https://ci-beam.apache.org/job/beam_PreCommit_Typescript_Phrase/) | `Run Typescript PreCommit` | [![Build Status](https://ci-beam.apache.org/job/beam_PreCommit_Typescript_Cron/badge/icon)](https://ci-beam.apache.org/job/beam_PreCommit_Typescript_Cron) |
4748

4849
### PostCommit Jobs
4950

sdks/python/scripts/run_eslint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121

2222
set -e
2323

24+
# jlpm needs Node.js to work.
25+
if ! command -v node; then
26+
echo "Node.js is not installed. Cannot execute the tests."
27+
exit 1
28+
fi
29+
2430
echo "Running eslint checks..."
2531

2632
# Source needed to run tests are copied to this build dir by the copyTsSource

sdks/python/scripts/run_jest.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020

2121
set -e
2222

23+
# jlpm needs Node.js to work.
24+
if ! command -v node; then
25+
echo "Node.js is not installed. Cannot execute the tests."
26+
exit 1
27+
fi
28+
2329
echo "Running jest tests..."
2430

2531
# Source needed to run tests are copied to this build dir by copySourceForJest
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
#
19+
# The script installs nodejs and needs to be executed before run_eslint and
20+
# run_jest.
21+
22+
set -e
23+
24+
if ! command -v node; then
25+
if command -v apt-get; then
26+
# From https://github.com/nodesource/distributions.
27+
curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
28+
sudo apt-get install -y nodejs
29+
elif command -v brew; then
30+
brew update
31+
brew install node
32+
fi
33+
fi

sdks/python/tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,13 @@ setenv =
339339
deps =
340340
jupyterlab==2.2.5
341341
commands =
342+
time {toxinidir}/scripts/setup_nodejs.sh
342343
time {toxinidir}/scripts/run_jest.sh
343344

344345
[testenv:eslint]
345346
setenv =
346347
deps =
347348
jupyterlab==2.2.5
348349
commands =
350+
time {toxinidir}/scripts/setup_nodejs.sh
349351
time {toxinidir}/scripts/run_eslint.sh

0 commit comments

Comments
 (0)