-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
java packaging tests #32143
Labels
:Delivery/Packaging
RPM and deb packaging, tar and zip archives, shell and batch scripts
Meta
>refactoring
Team:Delivery
Meta label for Delivery team
>test
Issues or PRs that are addressing/adding tests
v8.0.0-alpha1
Comments
andyb-elastic
added
>test
Issues or PRs that are addressing/adding tests
:Delivery/Packaging
RPM and deb packaging, tar and zip archives, shell and batch scripts
v7.0.0
labels
Jul 17, 2018
Pinging @elastic/es-core-infra |
Yes, #33729 covered basic windows service tests. |
pgomulka
added a commit
to pgomulka/elasticsearch
that referenced
this issue
Apr 3, 2019
) Migrating systemd bats tests from bats to java dsl. This also covers partially the sysv, but more must be added relates elastic#32143
pgomulka
added a commit
that referenced
this issue
Apr 4, 2019
pgomulka
added a commit
to pgomulka/elasticsearch
that referenced
this issue
Apr 4, 2019
) Migrating systemd bats tests from bats to java dsl. This also covers partially the sysv, but more must be added relates elastic#32143
@elastic/es-security there are security executables listed above that do not have test coverage in our packaging tests, so I'd like to ask for your help in adding coverage for these tests. |
mark-vieira
added
Team:Delivery
Meta label for Delivery team
and removed
Team:Core/Infra
Meta label for core/infra team
labels
Nov 11, 2020
Existing BATS tests have all been migrated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
:Delivery/Packaging
RPM and deb packaging, tar and zip archives, shell and batch scripts
Meta
>refactoring
Team:Delivery
Meta label for Delivery team
>test
Issues or PRs that are addressing/adding tests
v8.0.0-alpha1
This issue is following the work from #26741 and tracks what tests from the old bats project need to be ported to the new java project, as well as what new test coverage needs to be added
See here for info about how the java tests are structured (this may be a little out of date as some things have changed)
See here for instructions about how to run these tests, particularly this section about iterating more quickly which will save you a lot of time developing these tests
porting bats tests
Bats migration has been spun off into a separate issue: #46005
executable coverage
We currently don't have coverage for all executables that ship with the distributions. Note that the ones marked checked may only have coverage in a bats test that has not yet been ported
oss executables
elasticsearch
- Used in most testselasticsearch-env
- We check for its existence and it's used bybin/elasticsearch
so I think coverage here is fineelasticsearch-plugin
- used in 25_tar_plugins.bats and 50_modules_and_plugins.batselasticsearch-keystore
- We test for keystore usage in the basic tests which have been portedelasticsearch-translog
- We check for its existence but there's no usageelasticsearch-cli
- We don't check for its existence nor is there any usagewindows-specific executables
elasticsearch-service.bat
- we check for its existence but no usageelasticsearch-service-mgr.exe
- we check for its existence but no usageelasticsearch-service-x64.exe
- we check for its existence but no usagedefault executables
elasticsearch-certgen
- used in 40_tar_certgen.bats and 45_package_certgen.batselasticsearch-certutil
- we check for existence but no usageelasticsearch-coneval
- used in x-pack's 10_basic.batselasticsearch-migrate
- we check for existence but no usageelasticsearch-saml-metadata
- we check for existence but no usage (@jkakavas)elasticsearch-setup-passwords
- used in 30_tar_setup_password.bats and 35_package_setup_password.batselasticsearch-sql-cli
- used in 20_tar_bootstrap_password.bats and 25_package_bootstrap_password.batselasticsearch-syskeygen
- we check for existence but no usageelasticsearch-users
- we check for existence but not run (@jkakavas)x-pack-env
- we check for existence and it's used by other x-pack executables so I think we have coverage herex-pack-security-env
- we check for existence and it's used by other x-pack executables so I think we have coverage herex-pack-watcher-env
- we check for existence and it's used by other x-pack executables so I think we have coverage hereOther major things to do
Collecting logging so we can debug these tests when they fail. Most of them are transient and not reproducible, so what we currently do is collect the logs from the installed distribution and dump them to the console ([TEST] packaging: function to collect debug info #28608). We can port this by adding a junit test rule to the packaging test classes that does the same when a test method fails, which will have the added benefit of applying to every test (in the bash tests we would need to manually add a function call for it)
Test installing elasticsearch as a service on Windows - using the
elasticsearch-service.bat
executableOn Windows we should run the server as a role user because it works around some issues with how we're using windows powershell remoting (and because it's what we recommend). The remote shell runs as administrator, so to avoid running e.g. the server as administrator we have to "impersonate" the vagrant user to run commands not as-administrator. There's some more details about this here and here.
An example of one way to handle local windows users in powershell is in this feature branch. The relevant cmdlets are New-LocalUser, Get-LocalUser, and Remove-LocalUser. The server 2012r2 box may need an upgraded version of powershell and WMF to use these.
When running other powershell commands as a role user, (e.g.
elasticsearch-keystore
, not the server) it's probably best to use Invoke-Command (roughly equivalent tosudo -u elasticsearch foo
). For exampleThe text was updated successfully, but these errors were encountered: