Skip to content

Commit

Permalink
Fix and enable compiler plugin related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gayaldassanayake committed Dec 5, 2023
1 parent 561ef6a commit e066665
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 2 additions & 0 deletions cli/ballerina-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ dependencies {
compilerPluginJar project(':project-api-test-artifact:log-creator-pkg-provided-code-modifier')
compilerPluginJar project(':project-api-test-artifact:log-creator-pkg-provided-code-generator')
compilerPluginJar project(':project-api-test-artifact:log-creator-pkg-provided-code-analyzer')
compilerPluginJar project(':project-api-test-artifact:init-function-code-modify-compiler-plugin')
compilerPluginJar project(':project-api-test-artifact:diagnostic-utils-lib')
}

task createTestDistributionCache(type: Copy) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,15 @@ public void setup() throws IOException {
this.testResources = super.tmpDir.resolve("build-test-resources");
URI testResourcesURI = Objects.requireNonNull(getClass().getClassLoader().getResource("test-resources"))
.toURI();
Files.walkFileTree(Paths.get(testResourcesURI),
new BuildCommandTest.Copy(Paths.get(testResourcesURI), this.testResources));
Path testResourcesPath = Paths.get(testResourcesURI);
Files.walkFileTree(testResourcesPath,
new BuildCommandTest.Copy(testResourcesPath, this.testResources));

// Copy the compiler plugin jars to the test resources directory
Path compilerPluginJarsPath = Paths.get("build", "compiler-plugin-jars");
Files.walkFileTree(compilerPluginJarsPath,
new BuildCommandTest.Copy(compilerPluginJarsPath,
this.testResources.resolve("compiler-plugin-jars")));
} catch (URISyntaxException e) {
Assert.fail("error loading resources");
}
Expand Down Expand Up @@ -447,7 +454,7 @@ private void buildAndCacheCompilerPluginPackage() {
BCompileUtil.compileAndCacheBala(compilerPluginPath.toString());
}

@Test(enabled = false, description = "Pack a non template package with a compiler plugin dependency",
@Test(description = "Pack a non template package with a compiler plugin dependency",
groups = {"packWithCompilerPlugin"})
public void testPackNonTemplatePackageWithACompilerPackageDependency() throws IOException {

Expand All @@ -472,7 +479,7 @@ public void testPackNonTemplatePackageWithACompilerPackageDependency() throws IO
"returns error? {\n}"));
}

@Test(enabled = false, description = "Pack a template package with a compiler plugin dependency",
@Test(description = "Pack a template package with a compiler plugin dependency",
groups = {"packWithCompilerPlugin"})
public void testPackTemplatePackageWithACompilerPackageDependency() throws IOException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class = "io.samjs.plugins.init.codemodify.CodeModifyFunctionPlugin"

[[dependency]]
path = "../init-function-code-modify-compiler-plugin-1.0.0.jar"
path = "../../compiler-plugin-jars/init-function-code-modify-compiler-plugin-1.0.0.jar"

[[dependency]]
path = "../diagnostic-utils-lib-1.0.0.jar"
path = "../../compiler-plugin-jars/diagnostic-utils-lib-1.0.0.jar"

0 comments on commit e066665

Please sign in to comment.