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

wip: Update pdk and fix unit tests #213

Merged
merged 4 commits into from
Jun 21, 2019

Conversation

arcenik
Copy link
Contributor

@arcenik arcenik commented Jun 17, 2019

Updagrade PDK template and fixes spec error:

  • replace $::filebeat_version by $facts['filebeat_version']
  • add $queue_size and $registry_file in filebeat class

There is still some error with windows specs:

$ pdk test unit
pdk (INFO): Using Ruby 2.5.3
pdk (INFO): Using Puppet 6.4.0
[✔] Preparing to run the unit tests.
[✖] Running unit tests.
Run options: exclude {:bolt=>true}
  Evaluated 290 tests in 52.3588275 seconds: 1 failures, 0 pending.
failed: rspec: ./spec/classes/install/windows_spec.rb:16: expected that the catalogue would contain Archive[C:/Windows/Temp/filebeat-5.6.2-windows-x86_64.zip]
  filebeat::install::windows on windows-2012 R2-x64 should contain Archive[C:/Windows/Temp/filebeat-5.6.2-windows-x86_64.zip] with creates => "C:/Program Files/Filebeat/filebeat-5.6.2-windows-x86_64"
  Failure/Error:
          # it { is_expected.to compile }
          it { is_expected.to contain_file('C:/Program Files').with_ensure('directory') }
          it {
            is_expected.to contain_archive('C:/Windows/Temp/filebeat-5.6.2-windows-x86_64.zip').with(
              creates: 'C:/Program Files/Filebeat/filebeat-5.6.2-windows-x86_64',

Beside its running on Linux:

$ facter kernel
Linux

@pcfens
Copy link
Owner

pcfens commented Jun 20, 2019

Thanks for the work on this so far. My plan is to drop support for older versions of Filebeat in newer releases of the module, so I'd like to fix tests by removing the tests for Filebeat 5 rather than adding stuff back in.

If you don't have the time to work on this then feel free to close it, but feel free to delete a bunch of code out of the v5 tests too 😄.

@arcenik
Copy link
Contributor Author

arcenik commented Jun 21, 2019

Tests are green again !

@pcfens pcfens merged commit 869f5d7 into pcfens:master Jun 21, 2019
@pcfens
Copy link
Owner

pcfens commented Jun 21, 2019

Thanks for all your help on this!

@cdenneen
Copy link
Contributor

FYI the queue_size was removed in a1b47e2 so adding it back to fix tests is probably not correct.

Also the format for queue is no longer like this... there is queue.mem and queue.disk that should be configurable in the YAML:

https://github.com/elastic/beats/blob/main/filebeat/filebeat.reference.yml#L1281-L1335

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.

3 participants