Skip to content

test: verify used variables in different scenarios#90

Draft
nikku wants to merge 4 commits intomainfrom
used-by-tests
Draft

test: verify used variables in different scenarios#90
nikku wants to merge 4 commits intomainfrom
used-by-tests

Conversation

@nikku
Copy link
Member

@nikku nikku commented Mar 6, 2026

Proposed Changes

Validate scenarios for used variables, discussed here.

Scenario 1: Pro-code setup

This adds test cases for used variables - in the extreme case where no variables are produced ("pro-code"):

image

Scenario 2: Variable written and read (#91)

Validate representation of variable that is read and written by a task:

image image

Scenario 3: Variable attaches to correct scope (#92)

Verify that usedBy meta-data is attached to relevant scope:

image

Scenario 4: Proposed filtering mechanism (#93)

Verify the newly proposed filtering mechanism works:

image

From the documentation:

// variables available in scope of <task>
await variableResolver.getVariablesForElement(task);

// variables read by <task>, excluding local ones
await variableResolver.getVariablesForElement(task, { read: true, local: false });

// all variables written by <task>
await variableResolver.getVariablesForElement(task, { written: true });

Checklist

Ensure you provide everything we need to review your contribution:

  • Contribution meets our definition of done
  • Pull request establishes context
    • Link to related issue(s), i.e. Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}
    • Brief textual description of the changes
    • Screenshots or short videos showing UI/UX changes
    • Steps to try out, i.e. using the @bpmn-io/sr tool

@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Mar 6, 2026
Base automatically changed from test-helper to main March 6, 2026 14:22
@nikku nikku changed the title test: verify used variables in pro-code setup test: verify used variables in different scenarios Mar 7, 2026
@nikku
Copy link
Member Author

nikku commented Mar 7, 2026

Incorporated all tests into this PR - including new tests for filtering behavior - #93.

@nikku nikku requested a review from Buckwich March 9, 2026 08:50
Buckwich added a commit that referenced this pull request Mar 10, 2026
Buckwich added a commit that referenced this pull request Mar 10, 2026
note: internal usedby gets merged, thats why i added both tasks
Buckwich added a commit that referenced this pull request Mar 11, 2026
note: internal usedby gets merged, thats why i added both tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in progress Currently worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants