Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Error while using the projects import page #2168

Closed
damien-urruty-sonarsource opened this issue Apr 25, 2022 · 0 comments
Closed

Error while using the projects import page #2168

damien-urruty-sonarsource opened this issue Apr 25, 2022 · 0 comments
Labels
Milestone

Comments

@damien-urruty-sonarsource

Hello!

We have a test randomly failing when trying to import a project. The error is the following:

java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 7
	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
	at java.base/java.lang.String.substring(String.java:1874)
	at org.eclipse.reddeer.eclipse.ui.wizards.datatransfer.WizardProjectsImportPage.getProjectLabel(WizardProjectsImportPage.java:193)
	at org.eclipse.reddeer.eclipse.ui.wizards.datatransfer.WizardProjectsImportPage.getProjects(WizardProjectsImportPage.java:116)
	at org.sonarlint.eclipse.its.AbstractSonarLintTest.importExistingProjectIntoWorkspace(AbstractSonarLintTest.java:208)
	at org.sonarlint.eclipse.its.AbstractSonarLintTest.importExistingProjectIntoWorkspace(AbstractSonarLintTest.java:227)
	at org.sonarlint.eclipse.its.SecretsTest.shouldNotTriggerAnalysisForGitIgnoredFiles(SecretsTest.java:75)

The code that we use in our test is the following (can also be found here):

var dialog = new ExternalProjectImportWizardDialog();
dialog.open();
var importPage = new WizardProjectsImportPage(dialog);
importPage.copyProjectsIntoWorkspace(false);
importPage.setRootDirectory(projectFolder.getAbsolutePath());
var projects = importPage.getProjects();
assertThat(projects).hasSize(1);

We do have a video recording in the CI but the project label appears as expected:

Capture d’écran de 2022-04-25 14-56-46

Looking at the reddeer code I see how this error can occur as there is no check on the string. But the '(' should be present as shown in the screenshot. Also as the error points out the size of the label is 7 but I don't know what it is.

Anyone already faced the same problem ? Happy to help further if needed

odockal added a commit to odockal/reddeer that referenced this issue May 4, 2022
@odockal odockal closed this as completed in 32580d5 May 4, 2022
@odockal odockal added this to the 4.2.0 milestone Aug 1, 2022
@odockal odockal added the bug label Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants