Skip to content

test(agama): add transpiler finish and log codegen conformance tests#14488

Open
imran-ishaq wants to merge 2 commits into
mainfrom
agama-transpiler-finish-log-tests
Open

test(agama): add transpiler finish and log codegen conformance tests#14488
imran-ishaq wants to merge 2 commits into
mainfrom
agama-transpiler-finish-log-tests

Conversation

@imran-ishaq

@imran-ishaq imran-ishaq commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Prepare


Description

Adds FinishAndLogTest to the Agama transpiler module. It transpiles a flow that logs and finishes with a userId, and asserts the generated JavaScript contains the logging call, the flow-finish call and the finish value. Registered in the module's TestNG suite. No production change — confirms current code generation conforms to the language reference.

Target issue

The transpiler's Log and Finish statements are covered only by syntax-pass tests; nothing asserts they generate the expected runtime calls (logging call, flow-finish call) and carry the finish value, so a code-generation regression could go unnoticed.

closes #14487

Implementation Details

  • New test agama/transpiler/src/test/java/io/jans/agama/test/FinishAndLogTest.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.

Summary by CodeRabbit

  • Tests
    • Added coverage for transpiling flows that use Log and Finish statements.
    • Verified the generated output includes the expected runtime call markers and preserves literal argument values.
    • Registered the new test in the automated test suite.

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

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8430cba2-e8d9-446d-8aba-7fc9feef467c

📥 Commits

Reviewing files that changed from the base of the PR and between f9c59a5 and 93d2a4f.

📒 Files selected for processing (1)
  • agama/transpiler/src/test/java/io/jans/agama/test/FinishAndLogTest.java

📝 Walkthrough

Walkthrough

Adds a TestNG test that transpiles a DSL flow containing Log and Finish statements, verifies generated JavaScript calls and literal values, and registers the test in the suite configuration.

Changes

Finish and Log Test

Layer / File(s) Summary
Conformance test for Log/Finish code generation
agama/transpiler/src/test/java/io/jans/agama/test/FinishAndLogTest.java, agama/transpiler/src/test/resources/testng.xml
The test transpiles a flow, checks for _log2( and _finish( with the expected literals, and registers the test class in the TestNG suite.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding transpiler conformance tests for Finish and Log code generation.
Description check ✅ Passed The description follows the template and includes the target issue, implementation details, test evidence, and no-docs-impact confirmation.
Linked Issues check ✅ Passed The new test directly addresses #14487 by checking Log and Finish code generation and the finish value, matching the issue's criteria.
Out of Scope Changes check ✅ Passed The PR stays within scope: it adds a test and TestNG registration only, with no unrelated production or feature changes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agama-transpiler-finish-log-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 Jul 3, 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 Jul 3, 2026
@imran-ishaq
imran-ishaq marked this pull request as ready for review July 6, 2026 13:45
@imran-ishaq
imran-ishaq requested a review from jgomer2001 as a code owner July 6, 2026 13:45
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 6, 2026
…tead of inline Java

Signed-off-by: imran <imranishaq7071@gmail.com>
@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 finish and log code-generation conformance tests for the transpiler

3 participants