Skip to content

Commit

Permalink
Merge branch 'master' into 35947-legacy-expression-clause-filters-and…
Browse files Browse the repository at this point in the history
…-aggregations
  • Loading branch information
kamilmielnik committed Nov 23, 2023
2 parents 4eb9eda + b159e81 commit 3eb2f3c
Show file tree
Hide file tree
Showing 32 changed files with 772 additions and 325 deletions.
4 changes: 4 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ See docs on [upgrading Metabase](./installation-and-operation/upgrading-metabase

## Metabase Enterprise Edition releases

- [v1.47.8](https://github.com/metabase/metabase/releases/tag/v1.47.8)
- [v1.47.7](https://github.com/metabase/metabase/releases/tag/v1.47.7)
- [v1.47.6](https://github.com/metabase/metabase/releases/tag/v1.47.6)
- [v1.47.5](https://github.com/metabase/metabase/releases/tag/v1.47.5)
- [v1.47.4](https://github.com/metabase/metabase/releases/tag/v1.47.4)
Expand Down Expand Up @@ -128,6 +130,8 @@ See docs on [upgrading Metabase](./installation-and-operation/upgrading-metabase

## Metabase Open Source Edition releases

- [v0.47.8](https://github.com/metabase/metabase/releases/tag/v0.47.8)
- [v0.47.7](https://github.com/metabase/metabase/releases/tag/v0.47.7)
- [v0.47.6](https://github.com/metabase/metabase/releases/tag/v0.47.6)
- [v0.47.5](https://github.com/metabase/metabase/releases/tag/v0.47.5)
- [v0.47.4](https://github.com/metabase/metabase/releases/tag/v0.47.4)
Expand Down
58 changes: 32 additions & 26 deletions e2e/test/scenarios/permissions/application-permissions.cy.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
setTokenFeatures,
setupSMTP,
sidebar,
popover,
} from "e2e/support/helpers";

import { USERS } from "e2e/support/cypress_data";
Expand Down Expand Up @@ -133,36 +134,41 @@ describeEE("scenarios > admin > permissions > application", () => {
cy.signInAsNormalUser();
});

// Adding this test to quarantine. When it was failing was making all the subsequents to fail.
// More details can be found on the Thread https://metaboat.slack.com/archives/CKZEMT1MJ/p1649272824618149
it.skip("allows accessing tools, audit, and troubleshooting for non-admins", () => {
it("allows accessing tools, audit, and troubleshooting for non-admins", () => {
cy.visit("/");
cy.icon("gear").click();

// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Admin settings").click();
popover().findByText("Admin settings").click();

// Tools smoke test
cy.url().should("include", "/admin/tools/errors");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Questions that errored when last run");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("broken_question");

// Audit smoke test
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Audit").click();
cy.url().should("include", "/admin/audit/members/overview");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("All members").click();
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText(getFullName(admin));

// Troubleshooting smoke test
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Troubleshooting").click();
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Diagnostic Info");
cy.log("Tools smoke test");
cy.location("pathname").should("eq", "/admin/tools/errors");
cy.findByRole("heading", {
name: "Questions that errored when last run",
});
cy.findAllByRole("cell").should("contain", "broken_question");

cy.log("Audit smoke test");
cy.findByRole("navigation")
.findByRole("link", { name: "Audit" })
.click();
cy.location("pathname").should("eq", "/admin/audit/members/overview");
cy.findByRole("heading", {
name: "Team members",
});
cy.findByRole("radiogroup").contains("Audit log").click();
cy.location("pathname").should("eq", "/admin/audit/members/log");
cy.findAllByRole("cell")
.should("contain", "broken_question")
.and("contain", getFullName(admin));

cy.log("Troubleshooting smoke test");
cy.findByRole("navigation")
.findByRole("link", { name: "Troubleshooting" })
.click();
cy.location("pathname").should("eq", "/admin/troubleshooting/help");
cy.get("main")
.should("contain", "Help")
.and("contain", "Diagnostic Info");
});
});

Expand Down
23 changes: 10 additions & 13 deletions e2e/test/scenarios/sharing/approved-domains.cy.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,22 @@ describeEE(
visitQuestion(ORDERS_QUESTION_ID);

cy.icon("bell").click();
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Set up an alert").click();

// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Email alerts to:")
.parent()
.within(() => addEmailRecipient(deniedEmail));
cy.button("Set up an alert").click();

cy.findByRole("heading", { name: "Email" })
.closest("li")
.within(() => {
addEmailRecipient(deniedEmail);
cy.findByText(alertError);
});
cy.button("Done").should("be.disabled");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText(alertError);
});

// Adding test on Quarantine to understand a bit better some H2 Lock issue.
it.skip("should validate approved email domains for a dashboard subscription (metabase#17977)", () => {
it("should validate approved email domains for a dashboard subscription (metabase#17977)", () => {
visitDashboard(ORDERS_DASHBOARD_ID);
cy.icon("subscription").click();
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Email it").click();

cy.findByRole("heading", { name: "Email it" }).click();

sidebar().within(() => {
addEmailRecipient(deniedEmail);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import {
restore,
openProductsTable,
openOrdersTable,
popover,
sidebar,
visitQuestionAdhoc,
visualize,
summarize,
Expand Down Expand Up @@ -613,31 +611,49 @@ describe("scenarios > visualizations > drillthroughs > chart drill", () => {

describe("for an unsaved question", () => {
beforeEach(() => {
// Build a question without saving
openProductsTable();
summarize();
sidebar().within(() => {
cy.contains("Category").click();
});
const questionDetails = {
dataset_query: {
database: SAMPLE_DB_ID,
type: "query",
query: {
"source-table": PRODUCTS_ID,
aggregation: [["count"]],
breakout: [
[
"field",
PRODUCTS.CATEGORY,
{
"base-type": "type/Text",
},
],
],
},
},
};

visitQuestionAdhoc(questionDetails);

// Drill-through the last bar (Widget)
cy.get(".bar").last().click({ force: true });
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("See these Products").click();
popover().findByTextEnsureVisible("See these Products").click();
});

// [quarantine] flaky
it.skip("should result in a correct query result", () => {
it("should result in a correct query result", () => {
cy.log("Assert that the URL is correct");
cy.url().should("include", "/question#");

cy.log("Assert on the correct product category: Widget");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Category is Widget");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Gizmo").should("not.exist");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Doohickey").should("not.exist");
cy.findByTestId("qb-filters-panel").findByText("Category is Widget");

cy.findByTestId("question-row-count").should(
"have.text",
"Showing 54 rows",
);

cy.findByTestId("visualization-root")
.should("contain", "Widget")
.and("not.contain", "Gizmo")
.and("not.contain", "Doohickey");
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1078,3 +1078,37 @@
(get-in @dash1d [:tabs 0 :entity_id])))
(is (not= (:entity_id @tab1s)
(:entity_id @tab2d)))))))))

(deftest extraneous-keys-test
(let [serialized (atom nil)
eid (u/generate-nano-id)]
(ts/with-source-and-dest-dbs
(testing "Sprinkle the source database with a variety of different models"
(ts/with-source-db
(let [db (ts/create! Database :name "my-db")
card (ts/create! Card
:name "the query"
:query_type :native
:dataset true
:database_id (:id db)
:dataset_query {:database (:id db)
:native {:type :native
:native {:query "wow"}}})
parent (ts/create! Collection :name "Parent Collection" :location "/")
_child (ts/create! Collection
:name "Child Collection"
:location (format "/%d/" (:id parent)))
_action-id (action/insert! {:entity_id eid
:name "the action"
:model_id (:id card)
:type :query
:dataset_query "wow"
:database_id (:id db)})]
(reset! serialized
(->> (serdes.extract/extract {})
;; add an extra key to *every serialized model*
(map #(assoc % :my-extraneous-keeeeeey "foobar!!!!"))
(into []))))))
(testing "The extraneous keys do not interfere with loading"
(ts/with-dest-db
(is (serdes.load/load-metabase! (ingestion-in-memory @serialized))))))))
Loading

0 comments on commit 3eb2f3c

Please sign in to comment.