Skip to content

Commit

Permalink
Delete a medium test
Browse files Browse the repository at this point in the history
The test will be moved to clients, because we don't want to depend on an unreleased version of python
  • Loading branch information
damien-urruty-sonarsource committed May 25, 2021
1 parent ee269b8 commit 4eea2ea
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
<artifactItem>
<groupId>org.sonarsource.python</groupId>
<artifactId>sonar-python-plugin</artifactId>
<version>3.5.0.8200</version>
<version>1.14.0.3086</version>
<type>jar</type>
</artifactItem>
</artifactItems>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -873,30 +873,6 @@ void stop_module_should_stop_the_module_container() {
assertThat(moduleContainer.getPicoContainer().getLifecycleState().isStarted()).isFalse();
}

@Test
void python_symbol_table_should_bring_cross_file_issues() throws IOException {
ClientInputFile mainFile = prepareInputFile("main.py",
"from mod import add\n"
+ "def main():\n"
+ " add(1, 2)\n"
+ " add(1)\n",
false);
ClientInputFile moduleFile = prepareInputFile("mod.py",
"def add(a, b): return a+b",
false);
sonarlint.declareModule(new ModuleInfo("key", aClientFileSystemWith(mainFile, moduleFile)));

final List<Issue> issues = new ArrayList<>();
sonarlint.analyze(StandaloneAnalysisConfiguration.builder()
.setBaseDir(baseDir.toPath())
.addInputFile(mainFile)
.setModuleKey("key")
.build(), issues::add, null, null);

assertThat(issues).extracting(Issue::getRuleKey, Issue::getStartLine, i -> i.getInputFile().relativePath())
.containsExactly(tuple("python:S930", 4, "main.py"));
}

private ClientInputFile prepareInputFile(String relativePath, String content, final boolean isTest, Charset encoding, @Nullable Language language) throws IOException {
final File file = new File(baseDir, relativePath);
FileUtils.write(file, content, encoding);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class PluginLocator {
public static final String SONAR_JAVASCRIPT_PLUGIN_JAR_HASH = "2fab92be44e07f1d367f891a55258736";
public static final String SONAR_XOO_PLUGIN_NAME = "sonar-xoo-plugin";
public static final String SONAR_PHP_PLUGIN_JAR = "sonar-php-plugin-3.2.0.4868.jar";
public static final String SONAR_PYTHON_PLUGIN_JAR = "sonar-python-plugin-3.5.0.8200.jar";
public static final String SONAR_PYTHON_PLUGIN_JAR = "sonar-python-plugin-1.14.0.3086.jar";

public static URL getJavaPluginUrl() {
return getPluginUrl(SONAR_JAVA_PLUGIN_JAR);
Expand Down

0 comments on commit 4eea2ea

Please sign in to comment.