You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by ji...@apache.org on 2021/03/23 22:50:31 UTC

[druid] branch 0.20.2 updated (48953e35 -> 2016b52)

This is an automated email from the ASF dual-hosted git repository.

jihoonson pushed a change to branch 0.20.2
in repository https://gitbox.apache.org/repos/asf/druid.git.


    from 48953e35 Allow list for JDBC properties
     new 3282b6a  fix tests for java 11
     new 2016b52  Test UI to trigger auto compaction (#10469)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../PostgresqlFirehoseDatabaseConnectorTest.java   |  6 ++--
 web-console/e2e-tests/auto-compaction.spec.ts      | 21 +++++++------
 .../e2e-tests/component/datasources/overview.ts    | 36 ++++++++++++++++++----
 3 files changed, 44 insertions(+), 19 deletions(-)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[druid] 01/02: fix tests for java 11

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jihoonson pushed a commit to branch 0.20.2
in repository https://gitbox.apache.org/repos/asf/druid.git

commit 3282b6a7f0679578d8e03f4eacc7f37bc73fc3d1
Author: Jihoon Son <ji...@apache.org>
AuthorDate: Tue Mar 23 15:40:00 2021 -0700

    fix tests for java 11
---
 .../druid/firehose/PostgresqlFirehoseDatabaseConnectorTest.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/extensions-core/postgresql-metadata-storage/src/test/java/org/apache/druid/firehose/PostgresqlFirehoseDatabaseConnectorTest.java b/extensions-core/postgresql-metadata-storage/src/test/java/org/apache/druid/firehose/PostgresqlFirehoseDatabaseConnectorTest.java
index 229f1a4..4ab9ab3 100644
--- a/extensions-core/postgresql-metadata-storage/src/test/java/org/apache/druid/firehose/PostgresqlFirehoseDatabaseConnectorTest.java
+++ b/extensions-core/postgresql-metadata-storage/src/test/java/org/apache/druid/firehose/PostgresqlFirehoseDatabaseConnectorTest.java
@@ -87,7 +87,7 @@ public class PostgresqlFirehoseDatabaseConnectorTest
 
     JdbcAccessSecurityConfig securityConfig = newSecurityConfigEnforcingAllowList(ImmutableSet.of(""));
 
-    expectedException.expectMessage("The property [keyonly] is not in the allowed list");
+    expectedException.expectMessage("is not in the allowed list");
     expectedException.expect(IllegalArgumentException.class);
 
     new PostgresqlFirehoseDatabaseConnector(
@@ -132,7 +132,7 @@ public class PostgresqlFirehoseDatabaseConnectorTest
 
     JdbcAccessSecurityConfig securityConfig = newSecurityConfigEnforcingAllowList(ImmutableSet.of("none", "nonenone"));
 
-    expectedException.expectMessage("The property [keyonly] is not in the allowed list");
+    expectedException.expectMessage("is not in the allowed list");
     expectedException.expect(IllegalArgumentException.class);
 
     new PostgresqlFirehoseDatabaseConnector(
@@ -155,7 +155,7 @@ public class PostgresqlFirehoseDatabaseConnectorTest
 
     JdbcAccessSecurityConfig securityConfig = newSecurityConfigEnforcingAllowList(ImmutableSet.of("user", "nonenone"));
 
-    expectedException.expectMessage("The property [keyonly] is not in the allowed list");
+    expectedException.expectMessage("is not in the allowed list");
     expectedException.expect(IllegalArgumentException.class);
 
     new PostgresqlFirehoseDatabaseConnector(

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[druid] 02/02: Test UI to trigger auto compaction (#10469)

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jihoonson pushed a commit to branch 0.20.2
in repository https://gitbox.apache.org/repos/asf/druid.git

commit 2016b52abbff68c5e7f4583640a02dc9fb7cb054
Author: Chi Cao Minh <ch...@imply.io>
AuthorDate: Sun Oct 4 00:06:07 2020 -0700

    Test UI to trigger auto compaction (#10469)
    
    In the web console E2E tests, Use the new UI to trigger auto compaction
    instead of calling the REST API directly so that the UI is covered by
    tests.
---
 web-console/e2e-tests/auto-compaction.spec.ts      | 21 +++++++------
 .../e2e-tests/component/datasources/overview.ts    | 36 ++++++++++++++++++----
 2 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/web-console/e2e-tests/auto-compaction.spec.ts b/web-console/e2e-tests/auto-compaction.spec.ts
index 68cd00b..496e56a 100644
--- a/web-console/e2e-tests/auto-compaction.spec.ts
+++ b/web-console/e2e-tests/auto-compaction.spec.ts
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-import axios from 'axios';
 import path from 'path';
 import * as playwright from 'playwright-core';
 
@@ -25,7 +24,6 @@ import { Datasource } from './component/datasources/datasource';
 import { DatasourcesOverview } from './component/datasources/overview';
 import { HashedPartitionsSpec } from './component/load-data/config/partition';
 import { saveScreenshotIfError } from './util/debug';
-import { COORDINATOR_URL } from './util/druid';
 import { DRUID_EXAMPLES_QUICKSTART_TUTORIAL_DIR } from './util/druid';
 import { UNIFIED_CONSOLE_URL } from './util/druid';
 import { runIndexTask } from './util/druid';
@@ -77,7 +75,7 @@ describe('Auto-compaction', () => {
       // need several iterations if several time chunks need compaction
       let currNumSegment = uncompactedNumSegment;
       await retryIfJestAssertionError(async () => {
-        await triggerCompaction();
+        await triggerCompaction(page);
         currNumSegment = await waitForCompaction(page, datasourceName, currNumSegment);
 
         const compactedNumSegment = 2;
@@ -127,15 +125,18 @@ async function configureCompaction(
   const datasourcesOverview = new DatasourcesOverview(page, UNIFIED_CONSOLE_URL);
   await datasourcesOverview.setCompactionConfiguration(datasourceName, compactionConfig);
 
-  const savedCompactionConfig = await datasourcesOverview.getCompactionConfiguration(
-    datasourceName,
-  );
-  expect(savedCompactionConfig).toEqual(compactionConfig);
+  // Saving the compaction config is not instantaneous
+  await retryIfJestAssertionError(async () => {
+    const savedCompactionConfig = await datasourcesOverview.getCompactionConfiguration(
+      datasourceName,
+    );
+    expect(savedCompactionConfig).toEqual(compactionConfig);
+  });
 }
 
-async function triggerCompaction() {
-  const res = await axios.post(`${COORDINATOR_URL}/druid/coordinator/v1/compaction/compact`);
-  expect(res.status).toBe(200);
+async function triggerCompaction(page: playwright.Page) {
+  const datasourcesOverview = new DatasourcesOverview(page, UNIFIED_CONSOLE_URL);
+  await datasourcesOverview.triggerCompaction();
 }
 
 async function waitForCompaction(
diff --git a/web-console/e2e-tests/component/datasources/overview.ts b/web-console/e2e-tests/component/datasources/overview.ts
index 11f44b4..397f514 100644
--- a/web-console/e2e-tests/component/datasources/overview.ts
+++ b/web-console/e2e-tests/component/datasources/overview.ts
@@ -44,7 +44,6 @@ enum DatasourceColumn {
   ACTIONS,
 }
 
-const EDIT_COMPACTION_CONFIGURATION = 'Edit compaction configuration';
 const SKIP_OFFSET_FROM_LATEST = 'Skip offset from latest';
 
 /**
@@ -83,9 +82,8 @@ export class DatasourcesOverview {
     datasourceName: string,
     compactionConfig: CompactionConfig,
   ): Promise<void> {
-    await this.openEditActions(datasourceName);
+    await this.openCompactionConfigurationDialog(datasourceName);
 
-    await this.page.click(`"${EDIT_COMPACTION_CONFIGURATION}"`);
     await setLabeledInput(
       this.page,
       SKIP_OFFSET_FROM_LATEST,
@@ -96,10 +94,20 @@ export class DatasourcesOverview {
     await clickButton(this.page, 'Submit');
   }
 
-  async getCompactionConfiguration(datasourceName: string): Promise<CompactionConfig> {
+  private async openCompactionConfigurationDialog(datasourceName: string): Promise<void> {
     await this.openEditActions(datasourceName);
+    await this.clickMenuItem('Edit compaction configuration');
+    await this.page.waitForSelector('div.compaction-dialog');
+  }
+
+  private async clickMenuItem(text: string): Promise<void> {
+    const menuItemSelector = `//a[*[contains(text(),"${text}")]]`;
+    await this.page.click(menuItemSelector);
+  }
+
+  async getCompactionConfiguration(datasourceName: string): Promise<CompactionConfig> {
+    await this.openCompactionConfigurationDialog(datasourceName);
 
-    await this.page.click(`"${EDIT_COMPACTION_CONFIGURATION}"`);
     const skipOffsetFromLatest = await getLabeledInput(this.page, SKIP_OFFSET_FROM_LATEST);
     const partitionsSpec = await readPartitionSpec(this.page);
 
@@ -116,6 +124,22 @@ export class DatasourcesOverview {
 
     const editActions = await this.page.$$('span[icon=wrench]');
     editActions[index].click();
-    await this.page.waitFor('ul.bp3-menu');
+    await this.waitForPopupMenu();
+  }
+
+  private async waitForPopupMenu(): Promise<void> {
+    await this.page.waitForSelector('ul.bp3-menu');
+  }
+
+  async triggerCompaction(): Promise<void> {
+    await this.page.goto(this.baseUrl);
+    await this.clickMoreButton({ modifiers: ['Alt'] });
+    await this.clickMenuItem('Force compaction run');
+    await clickButton(this.page, 'Force compaction run');
+  }
+
+  private async clickMoreButton(options: any): Promise<void> {
+    await this.page.click('//button[span[@icon="more"]]', options);
+    await this.waitForPopupMenu();
   }
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org