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

windows packaging tests #26741

Closed
andyb-elastic opened this issue Sep 21, 2017 · 9 comments
Closed

windows packaging tests #26741

andyb-elastic opened this issue Sep 21, 2017 · 9 comments
Labels
:Delivery/Build Build or test infrastructure :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team >test Issues or PRs that are addressing/adding tests

Comments

@andyb-elastic
Copy link
Contributor

Add windows to the set of platforms we verify packaging correctness on.

The BATS tests will be rewritten in java/groovy so they'll be portable on all test platforms. We'd like to build these tests into a jar on the host and then execute the jar in the vm. Depending on how they're written it may make more sense to run them as a gradle task.

Because of licensing issues, we can't make a windows vagrant image publicly available. Users will be able to specify a windows image to use when running these tests, and the tests will include checks for correct java version, etc.

This was from a discussion with @tlrx @rjernst @nik9000 @jasontedor

@andyb-elastic andyb-elastic added :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts :Delivery/Build Build or test infrastructure v7.0.0 labels Sep 21, 2017
@andyb-elastic andyb-elastic self-assigned this Sep 21, 2017
@jasontedor
Copy link
Member

Supersedes #18475

@andyb-elastic
Copy link
Contributor Author

Here's roughly my roadmap for this since it's probably too much for one pull request

  • Add windows images for server 2012-r2 and 2016 for tests to the vagrantfile and vagrant test plugin. Allow an alternate windows image to be used by setting an environment variable. Don't run any tests on these boxes just yet

  • Create the groovy project that will be the new portable packaging tests. Add tasks to run these on all boxes, including the windows ones. Don't add all the tests to the new project yet. The bats tests will still run as usual

  • In parts, move tests from the bats project to the new groovy project. Once all tests are moved over, remove the bats tasks from the build.

  • Add testing windows installer as a service

@rjernst
Copy link
Member

rjernst commented Oct 12, 2017

Create the groovy project that will be the new portable packaging tests.

May I suggest qa/packaging? qa/vagrant was annoying for many reasons :). After all of them are transitioned, I think we can (and should) remove the remapping we do of the vagrant mount back to /vagrant.

@jasontedor
Copy link
Member

Add windows images for server 2012-r2 and 2016 for tests to the vagrantfile and vagrant test plugin. Allow an alternate windows image to be used by setting an environment variable. Don't run any tests on these boxes just yet

We should not enable these by default, and the boxes should not be mentioned in the Vagrantfile. The boxes that we are going to use are "closed source". We do not refer to "closed source" in the open source code base. We should not require open source users to specify an environment variable to get around running these on boxes they can not see. All that we should do is enable these to run if you provide your own box, which we will do on our internal CI.

Add testing windows installer as a service

Can you clarify what this refers to? I think that you mean installing Elasticsearch on Windows as a service, not using the Windows MSI installer but what you write could be interpreted as the latter.

@andyb-elastic
Copy link
Contributor Author

May I suggest qa/packaging? qa/vagrant was annoying for many reasons :). After all of them are transitioned, I think we can (and should) remove the remapping we do of the vagrant mount back to /vagrant

Sounds good, that seems cleaner 👍

We should not enable these by default, and the boxes should not be mentioned in the Vagrantfile. The boxes that we are going to use are "closed source". We do not refer to "closed source" in the open source code base. We should not require open source users to specify an environment variable to get around running these on boxes they can not see. All that we should do is enable these to run if you provide your own box, which we will do on our internal CI.

Agree, they won't run by default (when vagrant.boxes is unset). I think they should run with vagrant.boxes=all, and I can add options for linux-all (the current behavior of all) and windows-all

I see why we wouldn't want to mention the images explicitly in the Vagrantfile (although it looks like vagrant doesn't complain about not finding the image until you try to start it). They'll be hidden behind an environment variable in the Vagrantfile, something like

Vagrant.configure(2) do |config|
  if ENV['WINDOWS_PACKAGING']
    config.vm.define 'windows-server-2012r2' do |config|
      config.vm.box = ENV['WINDOWS_2012R2_VAGRANT_BOX']
    end
    config.vm.define 'windows-server-2016' do |config|
      config.vm.box = ENV['WINDOWS_2016_VAGRANT_BOX']
    end
  end
  # the other boxes
end

and then gradle will decide whether to set these env variables. I guess it can get the box names either from command line properties or its own environment (I'll favor command line props)

Can you clarify what this refers to? I think that you mean installing Elasticsearch on Windows as a service, not using the Windows MSI installer but what you write could be interpreted as the latter.

Right, the elasticsearch-service script, not the MSI

@jasontedor
Copy link
Member

Thanks @andyb-elastic, this sounds good to me now.

I guess it can get the box names either from command line properties or its own environment (I'll favor command line props)

I prefer properties too (we can do the -P thing that we already do.

Right, the elasticsearch-service script, not the MSI

Thank you for clarifying, I wanted to make sure the MSI is out of scope here (and belongs elsewhere, in the MSI repository).

@tlrx
Copy link
Member

tlrx commented Oct 13, 2017

Thanks @andyb-elastic, this plan looks good. Once the new packaging test project is available, we should make sure to involve many developers to convert the tests from bats to the new format. That will help to parallelize the work and spread the knowledge at the same time (we did this before when migrating settings to a new API or when adding integration test for aggregations).

andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue Dec 1, 2017
This creates projects for new packaging tests
written in groovy that can run on linux and
windows, and adds awareness of windows boxes
to the gradle build and Vagrantfile. No tests
have been ported here, the groovy tests just
exit immediately.

Also creates the project :qa:packaging-common
for code that should be shared between tests,
e.g. the kind of content that lives in the
utils/ portion of the bats tests. This is a
separate project so that extra plugins'
projects may depend on it without conflicting
with the tests' project.

The default is to not test on any windows boxes
unless explicitly specified (we can't provide
windows boxes) to gradle via project properties
or to vagrant via environment variables.

Once the bats tests in :qa:vagrant have all
been migrated, that project can be deleted
and the vagrant test plugin applied to
:qa:packaging directly, making it serve as both
the groovy build for the tests, and the tasks
that setup the VMs the tests run on.

For elastic#26741
andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue Dec 6, 2017
Vagrant boxes now include options for windows server 2012r2 and server
2016. Since licensing prevents us from providing windows images, they're
only configured in vagrant if passed via environment variables. The
windows boxes aren't used in gradle's packaging tests yet.

For elastic#26741
andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue Dec 8, 2017
andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue Dec 8, 2017
@andyb-elastic
Copy link
Contributor Author

We had a discussion about exactly what should be tested with plugins - currently (in bats) we just test that the plugins' jars are installed into the right place but some questioned the value of that. We may want to test basic functionality of the plugins if we can do that in a way that's not too involved.

andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue Jan 10, 2018
* Consolidates provision steps so it's more clear which steps are
applied to all boxes
* Removes duplicate configuration that was being stomped
* Ensure rsync, a dependency for platform steps, is installed on linux
* Ruby style changes

For elastic#26741
andyb-elastic added a commit that referenced this issue Feb 2, 2018
* Consolidates provision steps so it's more clear which steps are
applied to all boxes
* Removes duplicate configuration that was being stomped
* Ensure rsync, a dependency for platform steps, is installed on linux
* Ruby style changes

For #26741
andyb-elastic added a commit that referenced this issue Feb 2, 2018
* Consolidates provision steps so it's more clear which steps are
applied to all boxes
* Removes duplicate configuration that was being stomped
* Ensure rsync, a dependency for platform steps, is installed on linux
* Ruby style changes

For #26741
andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue Feb 2, 2018
Vagrant boxes now include options for windows server 2012r2 and server
2016. Since licensing prevents us from providing windows images, they're
only configured in vagrant if passed via environment variables. The
windows boxes aren't used in gradle's packaging tests yet.

For elastic#26741
andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue Mar 14, 2018
The vagrant test plugin adds tasks for the groovy packaging tests,
which run after the bats packaging test tasks.Rename the 'bats'
configuration to 'packaging' and remove the option to inherit
archives from this configuration.

For elastic#26741
andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue Mar 29, 2018
Adds behavior to the vagrant test plugin that runs jars from the
packagingTest configuration inside test VMs. Makes :qa:vagrant a project
which builds such a packaging test uberjar. This test project doesn't
run anything yet.

For elastic#26741
@colings86 colings86 added the >test Issues or PRs that are addressing/adding tests label Apr 24, 2018
andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue Apr 26, 2018
Adds a project for building and running packaging tests written in java
for portability. The vagrant tasks use jars on the packagingTest
configuration, which are built in the same project. No tests are added
yet.

Corresponding changes are not made to :x-pack:qa:vagrant because the
java packaging tests will all be consolidated into one project.

For elastic#26741
Tim-Brooks pushed a commit to Tim-Brooks/elasticsearch that referenced this issue Apr 30, 2018
[test] add java packaging test project

Adds a project for building and running packaging tests written in java
for portability. The vagrant tasks use jars on the packagingTest
configuration, which are built in the same project. No tests are added
yet.

Corresponding changes are not made to :x-pack:qa:vagrant because the
java packaging tests will all be consolidated into one project.

For elastic#26741
andyb-elastic added a commit that referenced this issue May 1, 2018
[test] add java packaging test project

Adds a project for building and running packaging tests written in java
for portability. The vagrant tasks use jars on the packagingTest
configuration, which are built in the same project. No tests are added
yet.

Corresponding changes are not made to :x-pack:qa:vagrant because the
java packaging tests will all be consolidated into one project.

For #26741
andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue May 7, 2018
Adds windows server 2012r2 and 2016 vagrant boxes to packaging tests.
They can only be used if IDs for their images are specified, which are
passed to gradle and then to vagrant via env variables. Adds options
to the project property `vagrant.boxes` to choose between linux and
windows boxes

Bats tests are run only on linux boxes, and portable packaging tests run
on all boxes. Platform tests are only run on linux boxes since they are
not being maintained.

For elastic#26741
andyb-elastic added a commit that referenced this issue May 16, 2018
Adds windows server 2012r2 and 2016 vagrant boxes to packaging tests.
They can only be used if IDs for their images are specified, which are
passed to gradle and then to vagrant via env variables. Adds options
to the project property `vagrant.boxes` to choose between linux and
windows boxes.

Bats tests are run only on linux boxes, and portable packaging tests run
on all boxes. Platform tests are only run on linux boxes since they are
not being maintained.

For #26741
andyb-elastic added a commit that referenced this issue May 17, 2018
Adds windows server 2012r2 and 2016 vagrant boxes to packaging tests.
They can only be used if IDs for their images are specified, which are
passed to gradle and then to vagrant via env variables. Adds options
to the project property `vagrant.boxes` to choose between linux and
windows boxes.

Bats tests are run only on linux boxes, and portable packaging tests run
on all boxes. Platform tests are only run on linux boxes since they are
not being maintained.

For #26741
andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue May 18, 2018
Ports the first couple tests for archive distributions from the old bats
project to the new java project that includes windows platforms,
consolidating them into one test method that tests that the
distributions can be extracted and their contents verified. Includes the
zip distributions which were not tested in the bats project.

For elastic#26741
ywelsch pushed a commit to ywelsch/elasticsearch that referenced this issue May 23, 2018
Adds windows server 2012r2 and 2016 vagrant boxes to packaging tests.
They can only be used if IDs for their images are specified, which are
passed to gradle and then to vagrant via env variables. Adds options
to the project property `vagrant.boxes` to choose between linux and
windows boxes.

Bats tests are run only on linux boxes, and portable packaging tests run
on all boxes. Platform tests are only run on linux boxes since they are
not being maintained.

For elastic#26741
andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue Jul 10, 2018
Add packaging tests for the linux package distributions to the java test
project and remove them from bats. Most of the tests that lived in
30_deb_package.bats and 40_rpm_package.bats are applicable to both
package types and are combined into a single type of test case. Others
are separated out into separate cases to make their intent more clear

For elastic#26741
andyb-elastic added a commit that referenced this issue Jul 19, 2018
Add packaging tests for the linux package distributions to the java test
project and remove them from bats. Most of the tests that lived in
30_deb_package.bats and 40_rpm_package.bats are applicable to both
package types and are combined into a single type of test case. Others
are separated out into separate cases to make their intent more clear

For #26741
andyb-elastic added a commit to andyb-elastic/elasticsearch that referenced this issue Jul 19, 2018
Add packaging tests for the linux package distributions to the java test
project and remove them from bats. Most of the tests that lived in
30_deb_package.bats and 40_rpm_package.bats are applicable to both
package types and are combined into a single type of test case. Others
are separated out into separate cases to make their intent more clear

For elastic#26741
andyb-elastic added a commit that referenced this issue Jul 24, 2018
Add packaging tests for the linux package distributions to the java test
project and remove them from bats. Most of the tests that lived in
30_deb_package.bats and 40_rpm_package.bats are applicable to both
package types and are combined into a single type of test case. Others
are separated out into separate cases to make their intent more clear

For #26741
@andyb-elastic
Copy link
Contributor Author

Closing this as the new portable test project is created and running in CI, and basic tests have been ported over to it for all distributions we're currently testing. New work on porting and filling out packaging tests will be tracked in #32143

@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 :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team >test Issues or PRs that are addressing/adding tests
Projects
None yet
Development

No branches or pull requests

6 participants