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

Match timestamps without year in pipeline tests with regex #4984

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

taylor-swanson
Copy link
Contributor

What does this PR do?

  • Timestamps that are parsed without a year (such as those on BSD-style syslog messages) will have their expected values inherit the year the expected files are generated in. This means that tests will only pass in the year that the expected files are generated.
  • The relevant timestamp field (@timestamp, for example) has been added to the pipeline test config as a dynamic field, and a regex pattern is used to match the expected format of the timestamp.

Fixes the tests for the following packages:

  • cisco_aironet
  • cisco_ftd
  • cisco_ios
  • cisco_ise
  • cisco_secure_email_gateway
  • infoblox_nios
  • pfsense
  • symantec_endpoint
  • zscaler_zia

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • [ ] I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

How to test this PR locally

Related issues

- Timestamps that are parsed without a year (such as those on BSD-style
syslog messages) will have their expected values inherit the year the
expected files are generated in. This means that tests will only pass
in the year that the expected files are generated.
- The relevant timestamp field (@timestamp, for example) has been added
to the pipeline test config as a dynamic field, and a regex pattern is
used to match the expected format of the timestamp.
@taylor-swanson taylor-swanson added bug Something isn't working, use only for issues Team:Security-External Integrations flaky-test Unstable or unreliable test cases. labels Jan 12, 2023
@taylor-swanson taylor-swanson self-assigned this Jan 12, 2023
@taylor-swanson taylor-swanson removed the bug Something isn't working, use only for issues label Jan 12, 2023
@elasticmachine
Copy link

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-01-12T18:14:00.555+0000

  • Duration: 22 min 31 sec

Test stats 🧪

Test Results
Failed 0
Passed 201
Skipped 0
Total 201

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (13/13) 💚
Files 96.078% (49/51) 👎 -3.922
Classes 96.078% (49/51) 👎 -3.922
Methods 98.698% (455/461) 👍 8.407
Lines 91.078% (10270/11276) 👎 -4.898
Conditionals 100.0% (0/0) 💚

@taylor-swanson taylor-swanson marked this pull request as ready for review January 12, 2023 20:07
@taylor-swanson taylor-swanson requested a review from a team as a code owner January 12, 2023 20:07
@elasticmachine
Copy link

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@ebeahan ebeahan left a comment

Choose a reason for hiding this comment

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

LGTM

@taylor-swanson taylor-swanson merged commit 1b81b78 into elastic:main Jan 13, 2023
@taylor-swanson taylor-swanson deleted the 4950-timestamp-tests branch January 13, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Unstable or unreliable test cases.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants