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

[JENKINS-42082] Verify that you can put TEST in an env var name #167

Merged
merged 2 commits into from
Jul 24, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ public void simpleEnvironment() throws Exception {
public void envVarContainsTEST() throws Exception {
expect("envVarContainsTEST")
.logContains("TEST_VAR is BAR",
"VAR_TEST is VALID")
"VAR_TEST is VALID",
"TEST_VAR from shell is BAR",
"VAR_TEST from shell is VALID")
.go();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ pipeline {
steps {
echo "TEST_VAR is ${TEST_VAR}"
echo "VAR_TEST is ${VAR_TEST}"
sh 'echo "TEST_VAR from shell is ${TEST_VAR}"'
sh 'echo "VAR_TEST from shell is ${VAR_TEST}"'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the ${} are valid in bash but in this case unnecessary.
It might cause confusion that groovy is expected to expand it, at least I had to read it three times to get that :)

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be safe, should add

  sh "echo SH_TEST_VAR is $TEST_VAR"
  sh "echo SH_VAR_TEST is $VAR_TEST"

or similar.

}
}
Expand Down