Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions its/ruling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<test>!org.sonar.java.it.JavaRulingTest#sonarqube_server</test>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>only-jboss-project</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<test>org.sonar.java.it.JavaRulingTest#jboss_ejb3_tutorial</test>
<test>!org.sonar.java.it.JavaRulingTest#sonarqube_server, !org.sonar.java.it.JavaRulingTest#vibebot</test>
</configuration>
</plugin>
</plugins>
Expand Down
19 changes: 17 additions & 2 deletions its/ruling/src/test/java/org/sonar/java/it/JavaRulingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ public static void prepare_quality_profiles() throws Exception {
.forEach(ruleKey -> Fail.fail("Specified rule does not exist: " + ruleKey));

prepareDumpOldFolder();

Files.createDirectories(Paths.get("target", "performance"));
}

@AfterClass
Expand Down Expand Up @@ -361,6 +363,19 @@ public void regex_examples() throws IOException {
executeBuildWithCommonProperties(build, projectName);
}

/**
* Vibe-bot runs this test when testing samples; so it's excluded from the GitHub Actions workflow.
*/
@Test
Comment thread
asya-vorobeva marked this conversation as resolved.
public void vibebot() throws IOException {
String projectName = "vibebot";
File pomFile = FileLocation.of("../vibebot/pom.xml").getFile().getCanonicalFile();
prepareProject("org.vibebot:vibebot", projectName);
MavenBuild build = MavenBuild.create().setPom(pomFile).setCleanPackageSonarGoals().addArgument("-DskipTests");
build.setProperty("sonar.projectKey", "org.vibebot:vibebot");
executeBuildWithCommonProperties(build, projectName);
}

private static MavenBuild test_project(String projectKey, String projectName) throws IOException {
return test_project(projectKey, null, projectName);
}
Expand All @@ -377,7 +392,6 @@ private static MavenBuild test_project(String projectKey, @Nullable String path,
private static MavenBuild test_existing_project(String projectKey, String projectName) throws IOException {
String pomLocation = "../sources/" + projectName + "/pom.xml";
File pomFile = FileLocation.of(pomLocation).getFile().getCanonicalFile();
//prepareProject(projectKey, projectName);
MavenBuild mavenBuild = MavenBuild.create().setPom(pomFile).setCleanPackageSonarGoals().addArgument("-DskipTests");
mavenBuild.setProperty("sonar.projectKey", projectKey);
return mavenBuild;
Expand All @@ -400,7 +414,8 @@ private static void executeBuildWithCommonProperties(Build<?> build, String proj
build.setProperty("sonar.scanner.skipJreProvisioning", "true");
build.setProperty("sonar.cpd.exclusions", "**/*")
.setProperty("sonar.java.performance.measure", "true")
.setProperty("sonar.java.performance.measure.path", "target/performance/sonar.java.performance.measure.json")
.setProperty("sonar.java.performance.measure.path",
Paths.get("target/performance/sonar.java.performance.measure.json").toAbsolutePath().toString())
.setProperty("sonar.import_unknown_files", "true")
.setProperty("sonar.skipPackageDesign", "true")
.setProperty("sonar.lits.dump.old", effectiveDumpOldFolder.resolve(projectName).toString())
Expand Down
6 changes: 6 additions & 0 deletions its/ruling/src/test/resources/vibebot/java-S1120.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"org.vibebot:vibebot:src/main/java/org/vibebot/App.java": [
7,
10
]
}
5 changes: 5 additions & 0 deletions its/ruling/src/test/resources/vibebot/java-S1228.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"org.vibebot:vibebot": [
0
]
}
5 changes: 5 additions & 0 deletions its/ruling/src/test/resources/vibebot/java-S1451.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"org.vibebot:vibebot:src/main/java/org/vibebot/App.java": [
0
]
}
39 changes: 39 additions & 0 deletions its/vibebot/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>org.vibebot</groupId>
<artifactId>vibebot</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Vibebot</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>21</maven.compiler.release>
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>21</source>
<target>21</target>
<release>21</release>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
6 changes: 6 additions & 0 deletions its/vibebot/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sonar.projectKey=org.vibebot:vibebot
sonar.projectName=vibebot
sonar.projectVersion=1.0-SNAPSHOT

sonar.sources=src/main/java
sonar.java.source=21
12 changes: 12 additions & 0 deletions its/vibebot/src/main/java/org/vibebot/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.vibebot;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class App {
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);

public static void main(String[] args) {
LOGGER.info("Hello Nigel!");
}
}
Loading