Skip to content

test(agama): add transpiler control-flow codegen conformance tests#14427

Draft
imran-ishaq wants to merge 1 commit into
mainfrom
agama-transpiler-control-flow-tests
Draft

test(agama): add transpiler control-flow codegen conformance tests#14427
imran-ishaq wants to merge 1 commit into
mainfrom
agama-transpiler-control-flow-tests

Conversation

@imran-ishaq

Copy link
Copy Markdown
Contributor

Prepare


Description

Adds ControlFlowTest to the Agama transpiler module. It transpiles a flow using When/Otherwise, Match, Repeat
(with Quit When) and Iterate, and asserts the generated JavaScript contains the expected control structures (if/else,
equality match branches, counted loop, iteration loop, loop break). Registered in the module's TestNG suite. No
production change — confirms current code generation conforms to the language reference.

Target issue

The Agama transpiler's control-flow constructs (When/Otherwise, Match, Repeat/Quit When, Iterate) are exercised by
syntax-only pass tests, but nothing asserts that they generate the expected JavaScript control structures, so a
code-generation regression could go unnoticed.

closes #14426

Implementation Details

  • New test agama/transpiler/src/test/java/io/jans/agama/test/ControlFlowTest.java using Transpiler.transpile and asserting
    on the generated code.
  • Registered the class in agama/transpiler/src/test/resources/testng.xml.
  • Full transpiler suite passes (3 tests, 0 failures on this branch's base).

Test and Document the changes

  • Static code analysis has been run locally and issues have been fixed
  • Relevant unit and integration tests have been added/updated
  • Relevant documentation has been updated if any (i.e. user guides, installation and configuration guides, technical design docs etc)

Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with docs: to indicate documentation changes or if the below checklist is not selected.

  • I confirm that there is no impact on the docs due to the code changes in this PR.

Signed-off-by: imran <imranishaq7071@gmail.com>
@imran-ishaq imran-ishaq added this to the 2.3.0 milestone Jun 24, 2026
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: bdc068fd-9075-44e1-8c55-180472821e2e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agama-transpiler-control-flow-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mo-auto

mo-auto commented Jun 24, 2026

Copy link
Copy Markdown
Member

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@mo-auto mo-auto added area-CI Issue or changes required in automatic builds or CI infrastructure comp-agama Touching folder /agama labels Jun 24, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CI Issue or changes required in automatic builds or CI infrastructure comp-agama Touching folder /agama

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(agama): add control-flow code-generation conformance tests for the transpiler

2 participants