Skip to content

Commit

Permalink
Remove Node.js install from build tests
Browse files Browse the repository at this point in the history
The build tests script does not require Node.js so there's no need
to install it during setup.

Remove the call to `get_node` from the `extra_initialization` function
which is called for all tests types.

Add `get_node` to the function responsible for running npm install which
is called for all tests types that require Node.js (unit + integration)

Also remove unnecessary apt commands installing curl which is already
included in the test runner image.
  • Loading branch information
AlanGreene authored and tekton-robot committed Aug 14, 2023
1 parent 649e97a commit 5bfc9c2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ function post_build_tests() {

function get_node() {
echo "Installing Node.js"
apt-get update
apt-get install -y curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
Expand All @@ -75,6 +73,7 @@ function get_node() {

function node_npm_install() {
local failed=0
get_node
echo "Configuring npm"
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
Expand Down Expand Up @@ -118,7 +117,6 @@ function pre_integration_tests() {

function extra_initialization() {
echo "Script is running as $(whoami) on $(hostname)"
get_node
}

function unit_tests() {
Expand Down

0 comments on commit 5bfc9c2

Please sign in to comment.