Skip to content

Conversation

@bleskes
Copy link
Contributor

@bleskes bleskes commented Jul 3, 2017

Some times we need a fix / change to have two parts in two different branches (corresponding to two different ES releases). In order to be able to test these cases you need to run the BWC tests against a local branch rather than then using a branch from github.com/elastic/elasticsearch.

This PR adds a system property called tests.bwc.branch that allows you to do it. Note that I've chosen to go with the simplest code change for now, at the expense of some user friendliness. As follow ups, we can do some more git magic to make things nicer if people prefer

@bleskes bleskes added :Delivery/Build Build or test infrastructure v6.0.0 labels Jul 3, 2017
@bleskes bleskes requested review from jasontedor and rjernst July 3, 2017 06:56
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

I left some comments. I think the sys prop should also be called tests.bwc.refspec since it is including the remote (eg look at git help for git fetch, it takes refspec, not branch).

if (checkoutDir.exists() == false) {
commandLine = ['git', 'clone', rootDir, checkoutDir]
} else {
commandLine = ['git', 'fetch', 'origin']
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is correct. A clone should always be created. The origin remote only comes into play here because you know origin is the local checkout the bwc checkout was cloned from.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I follow - the previous logic checked if the directory existed and skipped cloning?

dependsOn fetchLatest
def String branch = System.getProperty("tests.bwc.branch", "upstream/${bwcBranch}")
if (branch.startsWith('upstream')) {
dependsOn fetchLatest
Copy link
Member

Choose a reason for hiding this comment

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

I think the fetchLatest should remain. I think we want to simply update fetchLatest to do a git fetch instead of git fetch upstream? Then whatever the specified ref is here (whether the default based on upstream or a local one based on origin) should be available.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea - it simplifies things and make them more powerful. I'll do that. Thanks.

@bleskes
Copy link
Contributor Author

bleskes commented Jul 6, 2017

@rjernst I applied your idea. Can you take another look?

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM

@bleskes bleskes merged commit f79c2cb into elastic:master Jul 7, 2017
@bleskes bleskes deleted the bwc_local_branch branch July 7, 2017 09:18
bleskes added a commit that referenced this pull request Jul 7, 2017
This is a regression introduced in #25510, which removed the explicit fetching of upstream. Sadly this doesn't work if you don't have any local branch referring to `upstream` as an upstream branch.
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jul 7, 2017
* master: (42 commits)
  Harden global checkpoint tracker
  Remove deprecated created and found from index, delete and bulk (elastic#25516)
  fix testEnsureVersionCompatibility for 5.5.0 release
  fix Version.v6_0_0 min compatibility version to 5.5.0
  Add bwc indices for 5.5.0
  Add v5_5_1 constant
  [DOCS] revise high level client Search Scroll API docs (elastic#25599)
  Improve REST error handling when endpoint does not support HTTP verb, add OPTIONS support (elastic#24437)
  Avoid SecurityException in repository-S3 on DefaultS3OutputStream.flush() (elastic#25254)
  [Tests] Add tests for CompletionSuggestionBuilder#build() (elastic#25575)
  Enable cross-setting validation
  [Docs] Fix typo in bootstrap-checks.asciidoc (elastic#25597)
  Index ids in binary form. (elastic#25352)
  bwc checkout should fetch from all remotes
  IndexingIT should check for global checkpoints regardless of master version
  [Tests] Add tests for PhraseSuggestionBuilder#build() (elastic#25571)
  Remove unused class MinimalMap (elastic#25590)
  [Docs] Document Scroll API for Java High Level REST Client (elastic#25554)
  Disable date field mapping changing (elastic#25285)
  Allow BWC Testing against a specific branch (elastic#25510)
  ...
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team v6.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants