Skip to content

Add unit test to grant that production aliases correspond to a published RubyGem#12993

Merged
andsel merged 5 commits intoelastic:masterfrom
andsel:feature/add_test_to_check_aliases_gems
Jun 21, 2021
Merged

Add unit test to grant that production aliases correspond to a published RubyGem#12993
andsel merged 5 commits intoelastic:masterfrom
andsel:feature/add_test_to_check_aliases_gems

Conversation

@andsel
Copy link
Contributor

@andsel andsel commented Jun 16, 2021

Release notes

[rn:skip]

What does this PR do?

Loads the production plugin_aliases.yml definition file and check that every alias has
a properly published gem on RubyGems.

  • add delete of generated plugin_aliases.yml to Gradle's clean task
  • fix task dependency for copyPluginAlias task

Why is it important/What is the impact to the user?

Before aliasing a plugin in production that plugin must have an empty gem, this test grant for this during the testing of Logstash.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@andsel
Copy link
Contributor Author

andsel commented Jun 16, 2021

Jenkins test this please

1 similar comment
@andsel
Copy link
Contributor Author

andsel commented Jun 17, 2021

Jenkins test this please

andsel added 3 commits June 17, 2021 09:36
…hed RubyGem

Loads the production plugin_aliases.yml definition file and check that every alias has
a properly published gem on RubyGems,
@andsel andsel force-pushed the feature/add_test_to_check_aliases_gems branch from 428b814 to 1abd759 Compare June 17, 2021 08:23
@andsel andsel requested a review from jsvd June 17, 2021 09:05
Copy link
Member

@jsvd jsvd left a comment

Choose a reason for hiding this comment

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

Testing this locally I couldn't make the test fail.
My steps:

  1. edit logstash-core/src/main/resources/org/logstash/plugins/AliasRegistry.yml:
input:
  elastic_agent: beats
  meh: tcp
  1. run ./gradlew javaTests --tests org.logstash.plugins.AliasRegistryTest.testProductionConfigAliasesGemsExists

  2. Observe that the test passes

It seems that the YAML isn't being loaded correctly, so the aliasesDefinitions Map is empty.

Copy link
Member

@jsvd jsvd left a comment

Choose a reason for hiding this comment

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

LGTM

@andsel andsel merged commit a5f3153 into elastic:master Jun 21, 2021
andsel added a commit to andsel/logstash that referenced this pull request Jun 21, 2021
…hed RubyGem (elastic#12993)

Loads the production plugin_aliases.yml definition file and check that every alias has
a properly published gem on RubyGems.

Adds clean up of plugin_aliases.yml files
Fixed task dependency for copyPluginAlias

(cherry picked from commit a5f3153)
andsel added a commit that referenced this pull request Jun 28, 2021
…hed RubyGem (#12993) (#13009)

Loads the production plugin_aliases.yml definition file and check that every alias has
a properly published gem on RubyGems.

Adds clean up of plugin_aliases.yml files
Fixed task dependency for copyPluginAlias

(cherry picked from commit a5f3153)
kares added a commit to kares/logstash that referenced this pull request Jul 1, 2021
* master: (41 commits)
  Test: resolve integration failure due ECS mode (elastic#13044)
  Feat: event factory support (elastic#13017)
  Doc: Add geoip database API to node stats (elastic#13019)
  Add geoip database metrics to /node/stats API (elastic#13004)
  ecs: on-by-default plus docs (elastic#12830)
  ispec: fix cross-spec leak from fatal error integration specs (elastic#13002)
  Fix UBI source URL (elastic#13008)
  update fpm to allow pkg creation on jdk11+jruby 9.2 (elastic#13005)
  Add unit test to grant that production aliases correspond to a published RubyGem (elastic#12993)
  Fix logstash.bat not setting exit code (elastic#12948)
  Use the OS separator to invoke gradlew from Rake script (elastic#13000)
  Allow per-pipeline config of ECS Compatibility mode via Central Management (elastic#12861)
  Update jinja2 dependency in docker build (elastic#12994)
  fix database manager with multiple pipelines (elastic#12862)
  Fix Reflections stack traces when process yml files in classpath and debug is enabled (elastic#12991)
  Fix/log4j routing to avoid create spurious file (elastic#12965)
  Deps: update JRuby to 9.2.19.0 (elastic#12989)
  Doc: Add tip for checking for existing field (elastic#12899)
  Added test to cover the installation of aliased plugins (elastic#12967)
  CI: Update logstash_release.json after 7.3.12 (elastic#12986)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants