Skip to content
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

combine query execution test case as they are not independent #3655

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ public record TimeStratifiedSelects(@NotNull String label, String description, @
@JsonIgnore
public boolean isSelectsUnique() {
return timeStratifiedSelects.stream().map(TimeStratifiedSelects::selects).flatMap(Collection::stream).map(InfoCardSelect::select).distinct().count()
== timeStratifiedSelects.stream().map(TimeStratifiedSelects::selects).flatMap(Collection::stream).count();
== timeStratifiedSelects.stream().map(TimeStratifiedSelects::selects).mapToLong(Collection::size).sum();
}

@ValidationMethod(message = "Labels must be unique.")
@JsonIgnore
public boolean isLabelsUnique() {
return timeStratifiedSelects.stream().map(TimeStratifiedSelects::selects).flatMap(Collection::stream).map(InfoCardSelect::label).distinct().count()
== timeStratifiedSelects.stream().map(TimeStratifiedSelects::selects).flatMap(Collection::stream).count();
== timeStratifiedSelects.stream().map(TimeStratifiedSelects::selects).mapToLong(Collection::size).sum();
}

@JsonIgnore
Expand Down Expand Up @@ -178,7 +178,7 @@ public String resolveSelectLabel(SelectResultInfo info) {
public List<Select> getSelects() {
return getInfoCardSelects().stream()
.map(InfoCardSelect::select)
.map(SelectId::<Select>resolve)
.map(SelectId::resolve)
.collect(Collectors.toList());
}

Expand All @@ -200,10 +200,10 @@ public ConceptId resolveSearchConcept() {


return searchFilters.stream()
.map(FilterId::<Filter<?>>resolve)
.map(FilterId::resolve)
.map(filter -> filter.getConnector().getConcept())
.distinct()
.map(Concept::getId)
.collect(MoreCollectors.onlyElement());
.collect(MoreCollectors.toOptional()).orElse(null);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Das hatte immer hierfür gesorgt:

WARN  [2025-01-24 14:26:16,984] com.bakdata.conquery.io.jetty.NoSuchElementExceptionMapper: Uncaught NoSuchElementException
! java.util.NoSuchElementException: null
! at com.google.common.collect.MoreCollectors$ToOptionalState.getElement(MoreCollectors.java:163)
! at com.google.common.collect.MoreCollectors.lambda$static$1(MoreCollectors.java:75)
! at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:686)
! at com.bakdata.conquery.models.datasets.PreviewConfig.resolveSearchConcept(PreviewConfig.java:207)
! at com.bakdata.conquery.resources.api.ConceptsProcessor.getEntityPreviewFrontendConfig(ConceptsProcessor.java:154)
! at com.bakdata.conquery.resources.api.DatasetResource.getEntityPreviewDefaultConnectors(DatasetResource.java:39)
! at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
! at java.base/java.lang.reflect.Method.invoke(Method.java:580)
! at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
! at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)
! at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189)

}
}
10 changes: 5 additions & 5 deletions cypress/e2e/frontend/test_1_runQuery.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("Run query", () => {
visitWithToken(USER_TOKEN_WITH_PERMISSIONS);
});

it("Can execute query and see it in the queries tab", () => {
it("Can execute query, see it in the queries tab and delete it", () => {
cy.get('[data-test-id="right-pane-container"] >div:visible').as("queryEditor");

// Drag concept to editor
Expand Down Expand Up @@ -40,18 +40,16 @@ describe("Run query", () => {
cy.get("@queryEditor").find('[data-test-id="query-runner-button"]').click();

cy.get("@queryEditor").contains("Ergebnisse");
});

it("Can see the executed query in the queries tab", () => {
// Lookup executed query in the previous queries tab
cy.get('[data-test-id="left-pane"]').contains("Anfragen").click();

cy.get('[data-test-id="left-pane-container"]').as("leftPaneContainer");

cy.get("@leftPaneContainer").contains("Ergebnisse");
cy.get("@leftPaneContainer").contains("Concept1");
});

it("Can delete the query", () => {
// Delete the Query
cy.get('[data-test-id="left-pane"]').contains("Anfragen").click();

cy.get('[data-test-id="left-pane-container"]').as("leftPaneContainer");
Expand All @@ -60,6 +58,8 @@ describe("Run query", () => {

cy.get('@executionList').find('[data-test-id="project-item-delete-button"]').click();
cy.get('@executionList').contains('Anfrage jetzt löschen').click();

cy.get('@leftPaneContainer').contains('Keine Anfragen / Formulare gefunden')
Comment on lines +61 to +62
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um sicher zu gehen, dass die Anfrage wirklich gelöscht wurde

});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const DeleteProjectItemButton = ({ item }: { item: ProjectItemT }) => {
<IconButton
icon={faTimes}
bare
title="delete"
data-test-id="project-item-delete-button"
/>
</WithTooltip>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/js/previous-queries/list/ProjectItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ const ProjectItem = forwardRef<
<IconButton
icon={isShared ? faUser : faUserRegular}
bare
title="share"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicht unbedingt nötig, der Browser hatte sich nur Beschwert, dass der button kein Title hatte

data-test-id="share"
onClick={onIndicateShare}
/>
</WithTooltip>
Expand Down
Loading