Skip to content
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

release-22.2: roachtest: fix js install command (gpg) #113786

Merged
merged 1 commit into from
Nov 4, 2023
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
49 changes: 29 additions & 20 deletions pkg/cmd/roachtest/tests/knex.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,30 +59,39 @@ func registerKnex(r registry.Registry) {
)
require.NoError(t, err)

err = repeatRunE(
ctx,
t,
c,
node,
"add nodesource key and deb repository",
`
// In case we are running into a state where machines are being reused, we first check to see if we
// can use npm to reduce the potential of trying to add another nodesource key
// (preventing gpg: dearmoring failed: File exists) errors.
err = c.RunE(
ctx, node, `sudo npm i -g npm`,
)

if err != nil {
err = repeatRunE(
ctx,
t,
c,
node,
"add nodesource key and deb repository",
`
sudo apt-get update && \
sudo apt-get install -y ca-certificates curl gnupg && \
sudo mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --batch --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list`,
)
require.NoError(t, err)

err = repeatRunE(
ctx, t, c, node, "install nodejs and npm", `sudo apt-get update && sudo apt-get -qq install nodejs`,
)
require.NoError(t, err)

err = repeatRunE(
ctx, t, c, node, "update npm", `sudo npm i -g npm`,
)
require.NoError(t, err)
)
require.NoError(t, err)

err = repeatRunE(
ctx, t, c, node, "install nodejs and npm", `sudo apt-get update && sudo apt-get -qq install nodejs`,
)
require.NoError(t, err)

err = repeatRunE(
ctx, t, c, node, "update npm", `sudo npm i -g npm`,
)
require.NoError(t, err)
}

err = repeatRunE(
ctx, t, c, node, "install mocha", `sudo npm i -g mocha`,
Expand Down
49 changes: 29 additions & 20 deletions pkg/cmd/roachtest/tests/nodejs_postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,30 +67,39 @@ func registerNodeJSPostgres(r registry.Registry) {
err = alterZoneConfigAndClusterSettings(ctx, t, version, c, node[0])
require.NoError(t, err)

err = repeatRunE(
ctx,
t,
c,
node,
"add nodesource key and deb repository",
`
// In case we are running into a state where machines are being reused, we first check to see if we
// can use npm to reduce the potential of trying to add another nodesource key
// (preventing gpg: dearmoring failed: File exists) errors.
err = c.RunE(
ctx, node, `sudo npm i -g npm`,
)

if err != nil {
err = repeatRunE(
ctx,
t,
c,
node,
"add nodesource key and deb repository",
`
sudo apt-get update && \
sudo apt-get install -y ca-certificates curl gnupg && \
sudo mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --batch --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list`,
)
require.NoError(t, err)

err = repeatRunE(
ctx, t, c, node, "install nodejs and npm", `sudo apt-get update && sudo apt-get -qq install nodejs`,
)
require.NoError(t, err)

err = repeatRunE(
ctx, t, c, node, "update npm", `sudo npm i -g npm`,
)
require.NoError(t, err)
)
require.NoError(t, err)

err = repeatRunE(
ctx, t, c, node, "install nodejs and npm", `sudo apt-get update && sudo apt-get -qq install nodejs`,
)
require.NoError(t, err)

err = repeatRunE(
ctx, t, c, node, "update npm", `sudo npm i -g npm`,
)
require.NoError(t, err)
}

err = repeatRunE(
ctx, t, c, node, "install yarn", `sudo npm i -g yarn`,
Expand Down
51 changes: 29 additions & 22 deletions pkg/cmd/roachtest/tests/sequelize.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,32 +90,39 @@ func registerSequelize(r registry.Registry) {
t.Fatal(err)
}

if err := repeatRunE(
ctx,
t,
c,
node,
"add nodesource key and deb repository",
`
// In case we are running into a state where machines are being reused, we first check to see if we
// can use npm to reduce the potential of trying to add another nodesource key
// (preventing gpg: dearmoring failed: File exists) errors.
if err := c.RunE(
ctx, node, `sudo npm i -g npm`,
); err != nil {
if err := repeatRunE(
ctx,
t,
c,
node,
"add nodesource key and deb repository",
`
sudo apt-get update && \
sudo apt-get install -y ca-certificates curl gnupg && \
sudo mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --batch --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list`,
); err != nil {
t.Fatal(err)
}

if err := repeatRunE(
ctx, t, c, node, "install nodejs and npm", `sudo apt-get update && sudo apt-get -qq install nodejs`,
); err != nil {
t.Fatal(err)
}

if err := repeatRunE(
ctx, t, c, node, "update npm", `sudo npm i -g npm`,
); err != nil {
t.Fatal(err)
); err != nil {
t.Fatal(err)
}

if err := repeatRunE(
ctx, t, c, node, "install nodejs and npm", `sudo apt-get update && sudo apt-get -qq install nodejs`,
); err != nil {
t.Fatal(err)
}

if err := repeatRunE(
ctx, t, c, node, "update npm", `sudo npm i -g npm`,
); err != nil {
t.Fatal(err)
}
}

if err := repeatRunE(
Expand Down
47 changes: 27 additions & 20 deletions pkg/cmd/roachtest/tests/typeorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,32 +87,39 @@ func registerTypeORM(r registry.Registry) {
t.Fatal(err)
}

if err := repeatRunE(
ctx,
t,
c,
node,
"add nodesource key and deb repository",
`
// In case we are running into a state where machines are being reused, we first check to see if we
// can use npm to reduce the potential of trying to add another nodesource key
// (preventing gpg: dearmoring failed: File exists) errors.
if err := c.RunE(
ctx, node, `sudo npm i -g npm`,
); err != nil {
if err := repeatRunE(
ctx,
t,
c,
node,
"add nodesource key and deb repository",
`
sudo apt-get update && \
sudo apt-get install -y ca-certificates curl gnupg && \
sudo mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --batch --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list`,
); err != nil {
t.Fatal(err)
}
); err != nil {
t.Fatal(err)
}

if err := repeatRunE(
ctx, t, c, node, "install nodejs and npm", `sudo apt-get update && sudo apt-get -qq install nodejs`,
); err != nil {
t.Fatal(err)
}
if err := repeatRunE(
ctx, t, c, node, "install nodejs and npm", `sudo apt-get update && sudo apt-get -qq install nodejs`,
); err != nil {
t.Fatal(err)
}

if err := repeatRunE(
ctx, t, c, node, "update npm", `sudo npm i -g npm`,
); err != nil {
t.Fatal(err)
if err := repeatRunE(
ctx, t, c, node, "update npm", `sudo npm i -g npm`,
); err != nil {
t.Fatal(err)
}
}

if err := repeatRunE(
Expand Down