Skip to content

Commit

Permalink
roachtest: fix env var passing in activerecord test
Browse files Browse the repository at this point in the history
This patch fixes the rails version pinning in the activerecord
roachtest. The rails version is passed in via the env variable
`RAILS_VERSION` and was previously being set before the `sudo`
in the adapter install command and thus erroneously discarded.

Release note: None
  • Loading branch information
andyyang890 committed Jan 24, 2023
1 parent c9f87cf commit 4d4539f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/cmd/roachtest/tests/activerecord.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func registerActiveRecord(r registry.Registry) {
"installing gems",
fmt.Sprintf(
`cd /mnt/data1/activerecord-cockroachdb-adapter/ && `+
`RAILS_VERSION=%s sudo bundle install`, supportedRailsVersion),
`sudo RAILS_VERSION=%s bundle install`, supportedRailsVersion),
); err != nil {
t.Fatal(err)
}
Expand All @@ -172,8 +172,9 @@ func registerActiveRecord(r registry.Registry) {
t.Status("running activerecord test suite")

result, err := c.RunWithDetailsSingleNode(ctx, t.L(), node,
`cd /mnt/data1/activerecord-cockroachdb-adapter/ && `+
`sudo RUBYOPT="-W0" TESTOPTS="-v" bundle exec rake test`,
fmt.Sprintf(
`cd /mnt/data1/activerecord-cockroachdb-adapter/ && `+
`sudo RAILS_VERSION=%s RUBYOPT="-W0" TESTOPTS="-v" bundle exec rake test`, supportedRailsVersion),
)

// Fatal for a roachprod or SSH error. A roachprod error is when result.Err==nil.
Expand Down

0 comments on commit 4d4539f

Please sign in to comment.