Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the idempotence of our modules by appliying them twice during tests #10909

Open
murdos opened this issue Sep 19, 2024 · 0 comments
Open

Comments

@murdos
Copy link
Contributor

murdos commented Sep 19, 2024

If you make the following change in jhlite code

===================================================================
diff --git a/src/test/java/tech/jhipster/lite/module/infrastructure/secondary/JHipsterModulesAssertions.java b/src/test/java/tech/jhipster/lite/module/infrastructure/secondary/JHipsterModulesAssertions.java
--- a/src/test/java/tech/jhipster/lite/module/infrastructure/secondary/JHipsterModulesAssertions.java	(revision be0077d5a9bf82daa53491602fbf125dd8d624c5)
+++ b/src/test/java/tech/jhipster/lite/module/infrastructure/secondary/JHipsterModulesAssertions.java	(date 1726733907913)
@@ -95,6 +95,9 @@
   public static JHipsterModuleAsserter assertThatModuleWithFiles(JHipsterModule module, ModuleFile... files) {
     addFilesToProject(module.projectFolder(), files);
 
+    // Applying the module a first time before applying it again to check the reliability
+    TestJHipsterModules.apply(module);
+
     return new JHipsterModuleAsserter(module);
   }

and then run tests, multiple modules tests are failing:

image

This shows that some text replacements are a bit fragile and not idempotent, it might be good to improve them.

@murdos murdos changed the title Improve the reliability of our modules by appliying them twice during tests Improve the idempotence of our modules by appliying them twice during tests Sep 19, 2024
pascalgrimaud pushed a commit that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant