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

add field ttl_status to sensu_check (cont) #1000

Merged
merged 1 commit into from
Oct 29, 2018
Merged

Conversation

treydock
Copy link
Collaborator

This is a continuation of #927 with unit tests added for new ttl_status property.

describe 'ttl_status parameter' do
subject { described_class.new(resource_hash)[:ttl_status] }

valid = [1, 0, '1', '0']
Copy link
Collaborator

Choose a reason for hiding this comment

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

'absent' is also valid and so is undef

Copy link
Collaborator

Choose a reason for hiding this comment

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

Data type:

Variant[Undef,Enum['absent'],Integer]

Copy link
Collaborator

Choose a reason for hiding this comment

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

'1' and '0' should not work since they are not integers

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They work because the type property munges with to_i if not absent. The validation in type takes place before munge. The data type isn't actually tested yet, should the behavior of type property match data type or should data type be updated to allow numeric strings?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems the data type should be updated to allow for stringified integers by using a regex.

@treydock
Copy link
Collaborator Author

Added pattern to datatype and tests for the sensu::check defined resource. Also updated tests for type property to check absent which was actually something I had to fix in validation.

REFERENCE.md Outdated
@@ -1914,6 +1914,15 @@ considered stale. Set this to 'absent' to remove it completely.

Default value: `undef`

##### `ttl_status`
Copy link
Collaborator

Choose a reason for hiding this comment

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

run rake reference to re-generate this as the data type in the docs does not match the code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or you can remove the file from the commit and it will get regenerated as part of the release process.

Co-authored-by: asiek191 <witkows@gmail.com>
Co-authored-by: Trey Dockendorf <treydock@gmail.com>
@treydock
Copy link
Collaborator Author

Removed change to REFERENCE.md and squashed all commits into one.

@ghoneycutt ghoneycutt merged commit 5c7dcec into sensu:master Oct 29, 2018
@ghoneycutt
Copy link
Collaborator

Released in v2.57.0

@treydock treydock deleted the 927 branch November 4, 2018 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants