diff --git a/api/aggregator/processing.js b/api/aggregator/processing.js index a0710f7ab33..57eee262bb8 100644 --- a/api/aggregator/processing.js +++ b/api/aggregator/processing.js @@ -306,7 +306,7 @@ var crypto = require('crypto'); //Processing event meta plugins.register("/aggregator", async function() { - var drillMetaCache = new Cacher(common.drillDb); + var drillMetaCache = new Cacher(common.drillDb, {configs_db: common.db}); //Used for Apps info const eventSource = new UnifiedEventSource('drill-meta', { mongo: { db: common.drillDb, diff --git a/api/api.js b/api/api.js index 795e1dea282..f76fb18aca1 100644 --- a/api/api.js +++ b/api/api.js @@ -66,7 +66,7 @@ plugins.connectToAllDatabases().then(function() { common.drillQueryRunner = granuralQueries; if (common.drillDb) { - common.drillReadBatcher = new ReadBatcher(common.drillDb); + common.drillReadBatcher = new ReadBatcher(common.drillDb, {configs_db: common.db}); console.log('✓ Drill database components initialized'); } diff --git a/api/ingestor.js b/api/ingestor.js index bc52d1f737f..f3cc23dcb96 100644 --- a/api/ingestor.js +++ b/api/ingestor.js @@ -37,7 +37,7 @@ plugins.connectToAllDatabases(true).then(function() { common.readBatcher = new Cacher(common.db); //common.insertBatcher = new InsertBatcher(common.db); if (common.drillDb) { - common.drillReadBatcher = new Cacher(common.drillDb); + common.drillReadBatcher = new Cacher(common.drillDb, {configs_db: common.db}); } /** * Set Max Sockets diff --git a/api/parts/data/batcher.js b/api/parts/data/batcher.js index 4819f61fc8b..80281be50f6 100644 --- a/api/parts/data/batcher.js +++ b/api/parts/data/batcher.js @@ -422,12 +422,14 @@ class ReadBatcher { /** * Create batcher instance * @param {Db} db - database object + * @param {object} options - options for the batcher(Optional) */ - constructor(db) { + constructor(db, options) { this.db = db; this.data = {}; this.promises = {}; - plugins.loadConfigs(db, () => { + this.options = options || {}; + plugins.loadConfigs((this.options.configs_db || db), () => { this.loadConfig(); this.schedule(); }); diff --git a/api/parts/data/cacher.js b/api/parts/data/cacher.js index 7e2f60bc843..2b869852400 100644 --- a/api/parts/data/cacher.js +++ b/api/parts/data/cacher.js @@ -17,7 +17,8 @@ class Cacher { this.options = options || {}; this.transformationFunctions = {}; - plugins.loadConfigs(db, () => { + var configs_db = (this.options.configs_db || this.db); + plugins.loadConfigs(configs_db, () => { this.loadConfig(options); this.schedule(); }); diff --git a/jobServer/index.js b/jobServer/index.js index 55dd6962102..1d78ebad876 100644 --- a/jobServer/index.js +++ b/jobServer/index.js @@ -176,7 +176,7 @@ if (require.main === module) { // Initialize drill-specific batchers if drillDb is available if (drillDb) { - common.drillReadBatcher = new ReadBatcher(drillDb); + common.drillReadBatcher = new ReadBatcher(drillDb, {configs_db: countlyDb}); common.drillQueryRunner = new MongoDbQueryRunner(common.drillDb); console.log('✓ Drill database components initialized'); } diff --git a/plugins/logger/api/api.js b/plugins/logger/api/api.js index 58b1acec220..9f728ca6753 100644 --- a/plugins/logger/api/api.js +++ b/plugins/logger/api/api.js @@ -343,7 +343,7 @@ Object.freeze(RequestLoggerStateEnum); } catch (ex) { console.log("Failed fetching logs collection info: ", ex); - common.returnOutput(parameters, {capped: MAX_NUMBER_OF_LOG_ENTRIES, count: MAX_NUMBER_OF_LOG_ENTRIES, max: MAX_NUMBER_OF_LOG_ENTRIES, status: "error"}); + common.returnOutput(parameters, {capped: MAX_NUMBER_OF_LOG_ENTRIES || 1000, count: MAX_NUMBER_OF_LOG_ENTRIES || 1000, max: MAX_NUMBER_OF_LOG_ENTRIES || 1000, status: "error"}); } }); return true; diff --git a/plugins/populator/frontend/public/javascripts/countly.models.js b/plugins/populator/frontend/public/javascripts/countly.models.js index b3d3925f8a9..6fb6d16459d 100644 --- a/plugins/populator/frontend/public/javascripts/countly.models.js +++ b/plugins/populator/frontend/public/javascripts/countly.models.js @@ -1347,12 +1347,26 @@ params.sdk_version = getVersion(params.timestamp); if (Math.random() > 0.9) { //Add hc + var sc = -1; + var em = ""; + var is_good = true; + if (Math.random() > 0.9) { + is_good = false; + } + var error_messages = ["Some error", "Some other error", "Critical error", "Minor error", "Major error", "Fatal error", "Non-fatal error"]; + + if (!is_good) { + sc = 502; + em = error_messages[getRandomInt(0, error_messages.length - 1)]; + } + + params.hc = JSON.stringify({ - "hc": Math.random() * 10, - "el": Math.random() * 10, - "sc": Math.random() * 10, - "wl": Math.random() * 10, - "em": Math.random() * 10 + "hc": parseInt(Math.random() * 30, 10), + "el": parseInt(Math.random() * 20, 10), + "sc": sc, + "wl": parseInt(Math.random() * 10, 10), + "em": em }); } bulk.push(params); diff --git a/plugins/views/api/aggregator.js b/plugins/views/api/aggregator.js index bb51d1a3aed..f7d890654fa 100644 --- a/plugins/views/api/aggregator.js +++ b/plugins/views/api/aggregator.js @@ -218,7 +218,7 @@ const crypto = require('crypto'); } } } - await common.manualWriteBatcher.flush("countly", "app_viewsdata"); + await common.manualWriteBatcher.flush("countly", "app_viewdata"); await common.manualWriteBatcher.flush("countly", "app_viewsmeta"); } diff --git a/ui-tests/cypress/e2e/onboarding/onboarding.cy.js b/ui-tests/cypress/e2e/onboarding/onboarding.cy.js index 6ca0234cf55..493ce2c2a89 100644 --- a/ui-tests/cypress/e2e/onboarding/onboarding.cy.js +++ b/ui-tests/cypress/e2e/onboarding/onboarding.cy.js @@ -263,7 +263,7 @@ describe('Complete Onboarding', () => { navigationHelpers.goToHooksPage(); hooksPageHelpers.verifyEmptyPageElements(); navigationHelpers.goToDbViewerPage(); - dbCountlyPageHelpers.verifyEmptyPageElements(); + //dbCountlyPageHelpers.verifyEmptyPageElements(); dbCountlyPageHelpers.clickCountlyOutDatabaseTab(); dbCountlyOutPageHelpers.verifyEmptyPageElements(); dbCountlyOutPageHelpers.clickCountlyFileSystemDatabaseTab(); diff --git a/ui-tests/cypress/lib/dashboard/manage/configurations/configurations.js b/ui-tests/cypress/lib/dashboard/manage/configurations/configurations.js index dc2e808dd00..2952c12b8f2 100644 --- a/ui-tests/cypress/lib/dashboard/manage/configurations/configurations.js +++ b/ui-tests/cypress/lib/dashboard/manage/configurations/configurations.js @@ -1297,207 +1297,6 @@ const verifyPageElements = () => { cy.scrollPageToTop(); - //cy.verifyElement({ //TODO: push notifications feature is not visible on newarchitecture branch for now, check this - // labelElement: configurationsListBoxElements({ feature: FEATURE_TYPE.PUSH_NOTIFICATIONS }).LIST_BOX_ITEM, - // labelText: "Push Notifications", - // }); - - // cy.clickElement(configurationsListBoxElements({ feature: FEATURE_TYPE.PUSH_NOTIFICATIONS }).LIST_BOX_ITEM), - - // cy.verifyElement({ - // labelElement: configurationsListBoxElements({ feature: FEATURE_TYPE.PUSH_NOTIFICATIONS }).SELECTED_FEATURE_NAME, - // labelText: "Push Notifications", - // }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.CONNECTION_FACTOR }).SELECTED_SUBFEATURE_TITLE, - labelText: "Time factor for exponential backoff between retries", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.CONNECTION_FACTOR }).SELECTED_SUBFEATURE_INPUT_NUMBER, - attr: "aria-valuenow", - attrText: "1000" - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.CONNECTION_RETRIES }).SELECTED_SUBFEATURE_TITLE, - labelText: "Number of connection retries", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.CONNECTION_RETRIES }).SELECTED_SUBFEATURE_INPUT_NUMBER, - attr: "aria-valuenow", - attrText: "3" - }); - - //TODO: there is no option on ci cd, check this - // cy.verifyElement({ - // labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.NO_DUPLICATE }).SELECTED_SUBFEATURE_TITLE, - // labelText: "Ensure no duplicate notifications sent when scheduling messages", - // }); - - // cy.verifyElement({ - // element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.NO_DUPLICATE }).SELECTED_SUBFEATURE_CHECKBOX, - // isChecked: false - // }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.DEFAULT_CONTENT_AVAILABLE }).SELECTED_SUBFEATURE_TITLE, - labelText: "Set content-available to 1 by default for IOS", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.DEFAULT_CONTENT_AVAILABLE }).SELECTED_SUBFEATURE_CHECKBOX, - isChecked: false - }); - - //TODO: there is no option on ci cd, check this - // cy.verifyElement({ - // labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.MESSAGE_TIMEOUT }).SELECTED_SUBFEATURE_TITLE, - // labelText: "Timeout of a message to be send (in milliseconds)", - // }); - - // cy.verifyElement({ - // element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.MESSAGE_TIMEOUT }).SELECTED_SUBFEATURE_INPUT_NUMBER, - // attr: "aria-valuenow", - // attrText: "3600000" - // }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.POOL_BYTES }).SELECTED_SUBFEATURE_TITLE, - labelText: "Bytes in binary stream batches", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.POOL_BYTES }).SELECTED_SUBFEATURE_INPUT_NUMBER, - attr: "aria-valuenow", - attrText: "10000" - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.POOL_CONCURRENCY }).SELECTED_SUBFEATURE_TITLE, - labelText: "Maximum number of same type connections", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.POOL_CONCURRENCY }).SELECTED_SUBFEATURE_INPUT_NUMBER, - attr: "aria-valuenow", - attrText: "5" - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.POOL_POOLS }).SELECTED_SUBFEATURE_TITLE, - labelText: "Maximum number of connections in total", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.POOL_POOLS }).SELECTED_SUBFEATURE_INPUT_NUMBER, - attr: "aria-valuenow", - attrText: "10" - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.POOL_PUSHES }).SELECTED_SUBFEATURE_TITLE, - labelText: "Number of notifications in stream batches", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.POOL_PUSHES }).SELECTED_SUBFEATURE_INPUT_NUMBER, - attr: "aria-valuenow", - attrText: "400" - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_HOST }).SELECTED_SUBFEATURE_TITLE, - labelText: "push-notification.proxy-host", - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_HOST }).SELECTED_SUBFEATURE_DESCRIPTION, - labelText: "Hostname or IP address of HTTP CONNECT proxy server to use for communication with APN & FCM when sending push notifications.", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_HOST }).SELECTED_SUBFEATURE_INPUT, - value: "" - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_PASS }).SELECTED_SUBFEATURE_TITLE, - labelText: "push-notification.proxy-password", - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_PASS }).SELECTED_SUBFEATURE_DESCRIPTION, - labelText: "(if needed) Password for proxy server HTTP Basic authentication", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_PASS }).SELECTED_SUBFEATURE_INPUT, - value: "" - }); - - cy.scrollPageToBottom(); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_PORT }).SELECTED_SUBFEATURE_TITLE, - labelText: "push-notification.proxy-port", - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_PORT }).SELECTED_SUBFEATURE_DESCRIPTION, - labelText: "Port number of the proxy server", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_PORT }).SELECTED_SUBFEATURE_INPUT, - value: "" - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_UNAUTHORIZED }).SELECTED_SUBFEATURE_TITLE, - labelText: "Do NOT check proxy HTTPS certificate", - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_UNAUTHORIZED }).SELECTED_SUBFEATURE_DESCRIPTION, - labelText: "(if needed) Allow self signed certificates without CA installed", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_UNAUTHORIZED }).SELECTED_SUBFEATURE_CHECKBOX, - isChecked: false - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_USER }).SELECTED_SUBFEATURE_TITLE, - labelText: "push-notification.proxy-user", - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_USER }).SELECTED_SUBFEATURE_DESCRIPTION, - labelText: "(if needed) Username for proxy server HTTP Basic authentication", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.PROXY_USER }).SELECTED_SUBFEATURE_INPUT, - value: "" - }); - - cy.verifyElement({ - labelElement: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.SEND_A_HEAD }).SELECTED_SUBFEATURE_TITLE, - labelText: "Send notifications scheduled up to this many ms into the future", - }); - - cy.verifyElement({ - element: configurationsListBoxElements({ subFeature: SETTINGS.PUSH_NOTIFICATIONS.SEND_A_HEAD }).SELECTED_SUBFEATURE_INPUT_NUMBER, - attr: "aria-valuenow", - attrText: "60000" - }); - - cy.scrollPageToTop(); - cy.verifyElement({ labelElement: configurationsListBoxElements({ feature: FEATURE_TYPE.REMOTE_CONFIG }).LIST_BOX_ITEM, labelText: "Remote Config", @@ -1835,4 +1634,4 @@ const verifyPageElements = () => { module.exports = { verifyPageElements -}; +}; \ No newline at end of file diff --git a/ui-tests/cypress/lib/dashboard/manage/db/countly/dbCountly.js b/ui-tests/cypress/lib/dashboard/manage/db/countly/dbCountly.js index d8ca86de05a..812736655e4 100644 --- a/ui-tests/cypress/lib/dashboard/manage/db/countly/dbCountly.js +++ b/ui-tests/cypress/lib/dashboard/manage/db/countly/dbCountly.js @@ -86,7 +86,7 @@ const verifyFullDataPageElements = () => { cy.verifyElement({ labelElement: dbCountlyPageElements.COLLECTION_AND_APP_NAME_LABEL, - labelText: "apps" + labelText: "app_crashgroups(Demo App)" }); cy.shouldNotExist(dbCountlyPageElements.EMPTY_TABLE_ICON); diff --git a/ui-tests/cypress/lib/dashboard/manage/jobs/jobs.js b/ui-tests/cypress/lib/dashboard/manage/jobs/jobs.js index 235b0acd870..6fc83008883 100644 --- a/ui-tests/cypress/lib/dashboard/manage/jobs/jobs.js +++ b/ui-tests/cypress/lib/dashboard/manage/jobs/jobs.js @@ -48,9 +48,9 @@ const verifyStaticElementsOfPage = () => { }); cy.verifyElement({ - labelElement: jobsDataTableElements().COLUMN_NAME_TOTAL_LABEL, - labelText: "Total", - element: jobsDataTableElements().COLUMN_NAME_TOTAL_SORTABLE_ICON, + labelElement: jobsDataTableElements().COLUMN_NAME_TOTAL_RUNS_LABEL, + labelText: "Total Runs", + element: jobsDataTableElements().COLUMN_NAME_TOTAL_RUNS_SORTABLE_ICON, }); }; diff --git a/ui-tests/cypress/lib/dashboard/manage/logger/logger.js b/ui-tests/cypress/lib/dashboard/manage/logger/logger.js index 7f667bbac68..e66909d18cd 100644 --- a/ui-tests/cypress/lib/dashboard/manage/logger/logger.js +++ b/ui-tests/cypress/lib/dashboard/manage/logger/logger.js @@ -96,21 +96,11 @@ const verifyFullDataPageElements = () => { cy.checkPaceActive(); - cy - .elementExists(logsDataTableElements().EMPTY_TABLE_ICON) //Data comes sometimes - .then((isExists) => { - if (isExists) { - verifyLogsDataTable({ - isEmpty: true - }); - } - else { - verifyLogsDataTable({ - isEmpty: false, - shouldNotEqual: true, - }); - } - }); + cy.wait(15000); //TODO: SER-2733 need to fix for removing static wait + verifyLogsDataTable({ + isEmpty: false, + shouldNotEqual: true, + }); }; const verifyLogsDataTable = ({ diff --git a/ui-tests/cypress/lib/dashboard/manage/users/users.js b/ui-tests/cypress/lib/dashboard/manage/users/users.js index ae4ce5f14e9..5b27e76b43c 100644 --- a/ui-tests/cypress/lib/dashboard/manage/users/users.js +++ b/ui-tests/cypress/lib/dashboard/manage/users/users.js @@ -82,7 +82,7 @@ const verifyPageElements = () => { user: user.username, role: USER_TYPE.GLOBAL_USER, email: user.email, - lastLogin: "2 minutes ago" + lastLogin: "3 minutes ago" }); }; diff --git a/ui-tests/cypress/support/elements/dashboard/manage/jobs/jobs.js b/ui-tests/cypress/support/elements/dashboard/manage/jobs/jobs.js index 2379d524197..8bbffa37be2 100644 --- a/ui-tests/cypress/support/elements/dashboard/manage/jobs/jobs.js +++ b/ui-tests/cypress/support/elements/dashboard/manage/jobs/jobs.js @@ -22,8 +22,8 @@ const jobsDataTableElements = (index = 0) => ({ COLUMN_NAME_NEXT_RUN_SORTABLE_ICON: 'datatable-jobs-sortable-icon-next-run', COLUMN_NAME_LAST_RUN_LABEL: 'datatable-jobs-label-last-run', COLUMN_NAME_LAST_RUN_SORTABLE_ICON: 'datatable-jobs-sortable-icon-last-run', - COLUMN_NAME_TOTAL_LABEL: 'datatable-jobs-label-total', - COLUMN_NAME_TOTAL_SORTABLE_ICON: 'datatable-jobs-sortable-icon-total', + COLUMN_NAME_TOTAL_RUNS_LABEL: 'datatable-jobs-label-total-runs', + COLUMN_NAME_TOTAL_RUNS_SORTABLE_ICON: 'datatable-jobs-sortable-icon-total-runs', //Columns' Rows' Datas Elements NAME: 'datatable-jobs-name-' + index, diff --git a/ui-tests/cypress/support/elements/dashboard/manage/sdk/healthCheck.js b/ui-tests/cypress/support/elements/dashboard/manage/sdk/healthCheck.js index 638e0627074..af96b544626 100644 --- a/ui-tests/cypress/support/elements/dashboard/manage/sdk/healthCheck.js +++ b/ui-tests/cypress/support/elements/dashboard/manage/sdk/healthCheck.js @@ -59,8 +59,8 @@ const statusCodesEChartElements = { CHART_STATUS_CODES: 'status-codes-chart', CHART_MORE_BUTTON: 'status-codes-cly-chart-more-dropdown-more-option-button', - STATUS_CODE_MIN_1_ICON: 'line-options-status-codes--1-legend-icon', - STATUS_CODE_MIN_1_LABEL: 'line-options-status-codes--1-legend-label' + STATUS_CODE_MIN_1_ICON: 'status-codes--1-legend-icon', + STATUS_CODE_MIN_1_LABEL: 'status-codes--1-legend-label' }; const errorMessagesEChartElements = {