-
Notifications
You must be signed in to change notification settings - Fork 56
Added inspection to show warnings from explain queries #18
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
Conversation
@Override | ||
public void setUp() throws Exception { | ||
super.setUp(); | ||
this.dsApi = dataSource().neo4j31(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to include neo4j30() data source in tests? Some of my tests are doing multi-neo4j-version tests.
This is not a requirement, more like general question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, dataSource here is used just to get an instance of data source api, so we could easily generate file name for data source specific cypher file.
We could remove it, but then the file name generation would be done somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are wrong. Data source is used not only for generation, but also for Query execution. You need to get actual notification somewhere :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, true. Completely forgot about that, while was writing comment :)
import com.neueda.jetbrains.plugin.graphdb.jetbrains.util.NameUtil; | ||
import com.neueda.jetbrains.plugin.graphdb.test.integration.neo4j.util.base.BaseIntegrationTest; | ||
|
||
public class CypherExplainWarningInspectionTest extends BaseIntegrationTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are go going to add more inspections in future. Let's extract some of the logic in "BaseInspectionTest"
Logic to extract:
- Inspection class to enable
- Configure from existing existing file + check highligting
- Create data source file + add file to project
myFixture.configureFromExistingVirtualFile(psiFile.getVirtualFile()); | ||
myFixture.checkHighlighting(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be test that check behaviour if we are in data source bound file, but there are no actual data source,
if (fileName.startsWith(GraphConstants.BOUND_DATA_SOURCE_PREFIX)) { | ||
DataSourcesComponent component = statement.getProject().getComponent(DataSourcesComponent.class); | ||
|
||
component.getDataSourceContainer() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
streams ftw
return null; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this empty line
|
||
@Nullable | ||
@Override | ||
public String loadDescription() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this accidentally added code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's help ourselves in future with writing tests
b1a040d
to
31b1e30
Compare
No description provided.