Skip to content

feat: introduce TextMate grammar testing with vscode-tmgrammar-test - #1004

Draft
valfirst with Copilot wants to merge 2 commits into
mainfrom
copilot/introduce-grammar-testing-setup
Draft

feat: introduce TextMate grammar testing with vscode-tmgrammar-test#1004
valfirst with Copilot wants to merge 2 commits into
mainfrom
copilot/introduce-grammar-testing-setup

Conversation

Copilot AI commented Apr 21, 2026

Copy link
Copy Markdown
Contributor
  • Install vscode-tmgrammar-test devDependency
  • Add test:grammar npm script to package.json
  • Add Grammar Tests step to .github/workflows/build.yml
  • Fix grammar bug: add GivenStories: to step rule while exclusion list
  • Rewrite vividus.story.test.story using JBehave story syntax and real VIVIDUS steps (web app scenario + parameterised examples)
  • Rewrite vividus.composite-step.test.steps using real VIVIDUS composite steps

- Install vscode-tmgrammar-test@0.1.3 as devDependency
- Add grammar test fixtures for story, composite-step and log grammars
- Add test:grammar npm script
- Add Grammar Tests step to CI build workflow
- Fix grammar bug: add GivenStories: to step while exclusion list

Agent-Logs-Url: https://github.com/vividus-framework/vividus-studio/sessions/de36eaab-bcc4-4839-9dc5-9043f2871185

Co-authored-by: valfirst <5081226+valfirst@users.noreply.github.com>
}
},
"while": "^((?!Scenario:|Given(?!Stories)|When|Then|And|Composite:|Before:|After:|Scope:|Outcome:|Examples:|!--).+)$",
"while": "^((?!Scenario:|GivenStories:|Given(?!Stories)|When|Then|And|Composite:|Before:|After:|Scope:|Outcome:|Examples:|!--).+)$",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this change needed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot resolve

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The begin pattern for the step rule already uses a negative lookahead (Given(?!Stories)) so a GivenStories: line never starts a step. However, the while continuation rule (which keeps consuming following lines as step wording) had no exclusion for GivenStories:. This means a GivenStories: keyword appearing directly after a step would be silently absorbed as vividus.step.wording instead of being tokenised as vividus.keyword.

Adding GivenStories: to the while exclusion list fixes that latent bug. The same commit also fixes Examples: (had a trailing space) → Examples:, which had the same silent-absorption problem for an Examples: line with no trailing space.

… steps

- vividus.story.test.story: uses Description/Meta/Lifecycle/Scenario/
  GivenStories/Examples from JBehave story syntax; steps taken from
  the vividus-sample-tests web app story (page navigation, field entry,
  button click, text verification) and a parameterised Examples table
- vividus.composite-step.test.steps: uses real composite steps from
  vividus-sample-tests (Android open side menu steps: tap, change
  context, swipe, reset) and REST API check steps (response code,
  JSON element value)

Agent-Logs-Url: https://github.com/vividus-framework/vividus-studio/sessions/5a210f88-d785-4b10-a73e-bef67df9aa5a

Co-authored-by: valfirst <5081226+valfirst@users.noreply.github.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.54%. Comparing base (bd17458) to head (c62e14c).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1004   +/-   ##
=========================================
  Coverage     87.54%   87.54%           
  Complexity      273      273           
=========================================
  Files            35       35           
  Lines          1044     1044           
  Branches         72       72           
=========================================
  Hits            914      914           
  Misses          119      119           
  Partials         11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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