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

Ruby: ignore meta ci messages in testing #43

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

luke-hill
Copy link
Contributor

@luke-hill luke-hill commented Sep 29, 2023

🤔 What's changed?

Add a test and new functionality to ignore both extra and missing keys that are of the Meta Envelope

⚡️ What's your motivation?

Fixes #41

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@luke-hill luke-hill changed the title Bugfix/41 ignore meta ci messages in testing Ruby: ignore meta ci messages in testing Sep 29, 2023
@luke-hill
Copy link
Contributor Author

Is this good to merge also (I've put changelogs in a bit prematurely for both fixes).

@@ -12,11 +12,13 @@ def compare(found, expected)

return errors if found_keys.sort == expected_keys.sort

missing_keys = (expected_keys - found_keys)
missing_keys = (expected_keys - found_keys).reject do |key|
ENV['CI'] && found.class == Cucumber::Messages::Meta && key == :ci
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to just do this regardless of the CI env var? I recall your machine happened to have something set for this, but what if it doesn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In hindsight yes, that's not a negative. But what it means is running on ci won't check this key.

But if this key is just jargon from the CI executor then it seems reasonable to just never match on it. However then we enter the realm of not testing a part of the schema ever? Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would say never match on it, JS and JVM do basically the same and the ci-environment library does thorough enough testing of its own. Really the focal point of CCK is the messages about the tests themselves.

@luke-hill luke-hill force-pushed the bugfix/41-ignore-meta-ci-messages-in-testing branch from e096b55 to 78627d6 Compare October 5, 2023 09:05
@luke-hill luke-hill merged commit e4f5ed1 into main Oct 5, 2023
@luke-hill luke-hill deleted the bugfix/41-ignore-meta-ci-messages-in-testing branch October 5, 2023 09:20
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.

Ruby: Disregard meta messages when running locally/remotely
2 participants