Skip to content

Conversation

@mohanachandran-s
Copy link
Contributor

@mohanachandran-s mohanachandran-s commented Dec 18, 2025

MOSIP-44097 - Globalized variable for Dependency json path and added property in kernel for flag for generating dependency json

Summary by CodeRabbit

  • New Features

    • Added an option to emit test-case dependency JSON files for local runs, improving visibility of test inter-dependencies.
    • Exposed a runtime-accessible path for test inter-dependency data to simplify local tooling access.
  • Chores

    • Updated test framework configuration formatting and properties to support the new dependency output and local execution workflows.

✏️ Tip: You can customize this high-level summary in your review settings.

…ernel for generating dependency json

Signed-off-by: Mohanachandran S <mohanachandran.s@technoforte.co.in>
@coderabbitai
Copy link

coderabbitai bot commented Dec 18, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a new public static field in BaseTestCase to hold a test-case inter-dependency JSON path and a new Kernel.properties flag generateDependencyJson to control emitting that JSON for local IDE runs.

Changes

Cohort / File(s) Summary
Test Case field
apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/BaseTestCase.java
Added public static String testCaseInterDependencyPath and imported java.nio.file.Paths to construct the path.
Configuration
apitest-commons/src/main/resources/config/Kernel.properties
Added generateDependencyJson = no in two contexts to control dependency JSON generation; minor whitespace/formatting adjustments around related keys.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Pay attention to initialization of the new static field and any places that should use it.
  • Verify property parsing/consumption elsewhere when generateDependencyJson is read.

Possibly related PRs

Suggested reviewers

  • lsivanand

Poem

🐇 I dug a little tunnel to a JSON trail,
A tiny path where test-deps leave a trail.
A flag to whisper "no" when you don't want to write,
I hop, I skip, the tests sleep tight tonight. 🥕✨

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically summarizes the main changes: introducing a globalized variable for dependency JSON path and adding a kernel property for generating dependency JSON, which directly aligns with the changeset.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2be525 and 373a5f9.

📒 Files selected for processing (1)
  • apitest-commons/src/main/resources/config/Kernel.properties (2 hunks)

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/BaseTestCase.java (1)

194-196: Consider aligning path construction with existing patterns for run-context awareness.

The path is constructed using user.dir and assumes an IDE directory structure (src/main/resources/config/). The codebase already has getGlobalResourcePath() (lines 228-249) that handles JAR vs IDE execution contexts differently. Since the related property generateDependencyJson in Kernel.properties is documented to work "only in case of local run using IDE," consider:

  1. Adding a run-context check to prevent misuse in JAR mode
  2. Following the existing pattern used by getGlobalResourcePath() for consistency
  3. Deferring path construction until it's needed (lazy initialization) rather than at class load time
🔎 Example approach using existing patterns:
-	public static String testCaseInterDependencyPath = Paths
-			.get(System.getProperty("user.dir"), "src", "main", "resources", "config", "testCaseInterDependency.json")
-			.toString();
+	private static String testCaseInterDependencyPath = null;
+	
+	public static String getTestCaseInterDependencyPath() {
+		if (testCaseInterDependencyPath == null) {
+			if (runTypeS.equalsIgnoreCase("IDE")) {
+				testCaseInterDependencyPath = Paths
+					.get(System.getProperty("user.dir"), "src", "main", "resources", "config", "testCaseInterDependency.json")
+					.toString();
+			} else {
+				logger.warn("testCaseInterDependencyPath is only supported in IDE mode");
+				testCaseInterDependencyPath = "";
+			}
+		}
+		return testCaseInterDependencyPath;
+	}
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a708a2a and e2be525.

📒 Files selected for processing (2)
  • apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/BaseTestCase.java (2 hunks)
  • apitest-commons/src/main/resources/config/Kernel.properties (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build-maven-apitest-commons / maven-build
  • GitHub Check: build-maven-authentication-demo-service / maven-build
  • GitHub Check: Analyze (java-kotlin)

Signed-off-by: Mohanachandran S <165888272+mohanachandran-s@users.noreply.github.com>
@mohanachandran-s mohanachandran-s merged commit 385f666 into mosip:develop Dec 18, 2025
4 of 5 checks passed
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.

2 participants