Skip to content

Skip honor refspec test if env is an empty value#1023

Merged
MarkEWaite merged 1 commit intojenkinsci:masterfrom
MarkEWaite:test-empty-value-expansion
Jan 8, 2021
Merged

Skip honor refspec test if env is an empty value#1023
MarkEWaite merged 1 commit intojenkinsci:masterfrom
MarkEWaite:test-empty-value-expansion

Conversation

@MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Jan 8, 2021

Fix array bounds exception in test run by PCT

Fixes an array out of bounds exception when the environment variable being tested is an empty string. The test is checking that the variable is correctly expanded in the refspec but is not designed to test the case where the expanded string is empty. Testing for an empty string expansion does not add enough value to the already existing tests.

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that verify my changes
  • Unit tests pass locally with my changes
  • I have added documentation as necessary
  • No Javadoc warnings were introduced with my changes
  • No spotbugs warnings were introduced with my changes
  • Documentation in README has been updated as necessary
  • Online help has been added and reviewed for any new or modified fields
  • I have interactively tested my changes
  • Any dependent changes have been merged and published in upstream modules (like git-client-plugin)

Types of changes

  • Dependency or infrastructure update

Further comments

It is possible to create a refspec that would work with the empty string value of the environment variable, but it is more complicated and does not add value to the scenarios evaluated by the test.

The plugin bom tests of the most recent git plugin release are failing because the plugin bom test environment has the value of the environment variable USER as the empty string.

See #1013 (comment) for more details

Fixes an array out of bounds when the environment variable being tested
is an empty string.  The test is checking that the variable is correctly
expanded in the refspec but is not designed to test the case where the
string is empty.  It is possible to create a refspec that would work
with the empty string value of the environment variable, but it is more
complicated and does not add value to the scenarios evaluated by the test.

The plugin bom tests of the most recent git plugin release are failing
because the plugin bom test environment has the value of the environment
variable `USER` as the empty string.
@MarkEWaite MarkEWaite merged commit 8d2c7f1 into jenkinsci:master Jan 8, 2021
@MarkEWaite MarkEWaite deleted the test-empty-value-expansion branch January 8, 2021 22:33
@MarkEWaite MarkEWaite added the test label Jan 9, 2021
@jglick
Copy link
Member

jglick commented Jan 11, 2021

(for jenkinsci/bom#393)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants