From 151230098c8faff8ae72cbd0a2b1090de610c33f Mon Sep 17 00:00:00 2001 From: "SPRINX0\\prochazka" Date: Mon, 10 Feb 2025 14:28:52 +0100 Subject: [PATCH 1/4] fix --- e2e-tests/cypress/e2e/browse-data.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-tests/cypress/e2e/browse-data.cy.js b/e2e-tests/cypress/e2e/browse-data.cy.js index b1dd797ef..87f16a17c 100644 --- a/e2e-tests/cypress/e2e/browse-data.cy.js +++ b/e2e-tests/cypress/e2e/browse-data.cy.js @@ -350,7 +350,7 @@ describe('Data browser data', () => { cy.themeshot('comparesettings'); }); - it.only('Query editor - AI assistant', () => { + it('Query editor - AI assistant', () => { cy.contains('MySql-connection').click(); cy.contains('MyChinook').click(); cy.testid('TabsPanel_buttonNewQuery').click(); From 6bf5c58ec145d513326f93c7270b0975d267f001 Mon Sep 17 00:00:00 2001 From: "SPRINX0\\prochazka" Date: Mon, 10 Feb 2025 15:22:49 +0100 Subject: [PATCH 2/4] fix --- e2e-tests/cypress/e2e/browse-data.cy.js | 4 +++- e2e-tests/e2eTestTools.js | 3 +++ packages/api/src/controllers/config.js | 12 +++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/e2e-tests/cypress/e2e/browse-data.cy.js b/e2e-tests/cypress/e2e/browse-data.cy.js index 87f16a17c..18bc8e586 100644 --- a/e2e-tests/cypress/e2e/browse-data.cy.js +++ b/e2e-tests/cypress/e2e/browse-data.cy.js @@ -350,11 +350,13 @@ describe('Data browser data', () => { cy.themeshot('comparesettings'); }); - it('Query editor - AI assistant', () => { + it.only('Query editor - AI assistant', () => { cy.contains('MySql-connection').click(); cy.contains('MyChinook').click(); cy.testid('TabsPanel_buttonNewQuery').click(); cy.testid('QueryTab_switchAiAssistantButton').click(); + cy.testid('QueryAiAssistant_allowSendToAiServiceButton').click(); + cy.testid('ConfirmModal_okButton').click(); cy.testid('QueryAiAssistant_promptInput').type('album names'); cy.testid('QueryAiAssistant_queryFromQuestionButton').click(); cy.contains('Use this').click(); diff --git a/e2e-tests/e2eTestTools.js b/e2e-tests/e2eTestTools.js index 417670d8e..2ff82a52f 100644 --- a/e2e-tests/e2eTestTools.js +++ b/e2e-tests/e2eTestTools.js @@ -22,6 +22,9 @@ function clearTestingData() { if (fs.existsSync(path.join(baseDir, 'connections-e2etests.jsonl'))) { fs.unlinkSync(path.join(baseDir, 'connections-e2etests.jsonl')); } + if (fs.existsSync(path.join(baseDir, 'settings-e2etests.jsonl'))) { + fs.unlinkSync(path.join(baseDir, 'settings-e2etests.jsonl')); + } if (fs.existsSync(path.join(baseDir, 'files-e2etests'))) { fs.rmdirSync(path.join(baseDir, 'files-e2etests'), { recursive: true }); } diff --git a/packages/api/src/controllers/config.js b/packages/api/src/controllers/config.js index bb2cd21e2..451331c55 100644 --- a/packages/api/src/controllers/config.js +++ b/packages/api/src/controllers/config.js @@ -136,7 +136,7 @@ module.exports = { deleteSettings_meta: true, async deleteSettings() { - await fs.unlink(path.join(datadir(), 'settings.json')); + await fs.unlink(path.join(datadir(), processArgs.runE2eTests ? 'settings-e2etests.json' : 'settings.json')); return true; }, @@ -161,7 +161,10 @@ module.exports = { async loadSettings() { try { - const settingsText = await fs.readFile(path.join(datadir(), 'settings.json'), { encoding: 'utf-8' }); + const settingsText = await fs.readFile( + path.join(datadir(), processArgs.runE2eTests ? 'settings-e2etests.json' : 'settings.json'), + { encoding: 'utf-8' } + ); return { ...this.fillMissingSettings(JSON.parse(settingsText)), 'other.licenseKey': platformInfo.isElectron ? await this.loadLicenseKey() : undefined, @@ -247,7 +250,10 @@ module.exports = { ...currentValue, ..._.omit(values, ['other.licenseKey']), }; - await fs.writeFile(path.join(datadir(), 'settings.json'), JSON.stringify(updated, undefined, 2)); + await fs.writeFile( + path.join(datadir(), processArgs.runE2eTests ? 'settings-e2etests.json' : 'settings.json'), + JSON.stringify(updated, undefined, 2) + ); // this.settingsValue = updated; if (currentValue['other.licenseKey'] != values['other.licenseKey']) { From bccfa79bb6b9faa18a7ee0c91168a5e9fa55bb09 Mon Sep 17 00:00:00 2001 From: "SPRINX0\\prochazka" Date: Mon, 10 Feb 2025 15:23:14 +0100 Subject: [PATCH 3/4] ref update --- .github/workflows/build-app-pro-beta.yaml | 2 +- .github/workflows/build-app-pro.yaml | 2 +- .github/workflows/build-aws-pro.yaml | 2 +- .github/workflows/build-docker-pro.yaml | 2 +- .github/workflows/build-npm-pro.yaml | 2 +- .github/workflows/e2e-pro.yaml | 2 +- workflow-templates/includes.tpl.yaml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-app-pro-beta.yaml b/.github/workflows/build-app-pro-beta.yaml index 733dc36dd..84774b2a2 100644 --- a/.github/workflows/build-app-pro-beta.yaml +++ b/.github/workflows/build-app-pro-beta.yaml @@ -39,7 +39,7 @@ jobs: repository: dbgate/dbgate-pro token: '${{ secrets.GH_TOKEN }}' path: dbgate-pro - ref: a2f824dc711b510a5e8235d3faf4aafab1965184 + ref: ca1a1664e4c45945d7afe9534c43ca6cbb0b06e3 - name: Merge dbgate/dbgate-pro run: | mkdir ../dbgate-pro diff --git a/.github/workflows/build-app-pro.yaml b/.github/workflows/build-app-pro.yaml index 3ab892a19..1c867176d 100644 --- a/.github/workflows/build-app-pro.yaml +++ b/.github/workflows/build-app-pro.yaml @@ -39,7 +39,7 @@ jobs: repository: dbgate/dbgate-pro token: '${{ secrets.GH_TOKEN }}' path: dbgate-pro - ref: a2f824dc711b510a5e8235d3faf4aafab1965184 + ref: ca1a1664e4c45945d7afe9534c43ca6cbb0b06e3 - name: Merge dbgate/dbgate-pro run: | mkdir ../dbgate-pro diff --git a/.github/workflows/build-aws-pro.yaml b/.github/workflows/build-aws-pro.yaml index 52fa8f321..2d98e2363 100644 --- a/.github/workflows/build-aws-pro.yaml +++ b/.github/workflows/build-aws-pro.yaml @@ -36,7 +36,7 @@ jobs: repository: dbgate/dbgate-pro token: '${{ secrets.GH_TOKEN }}' path: dbgate-pro - ref: a2f824dc711b510a5e8235d3faf4aafab1965184 + ref: ca1a1664e4c45945d7afe9534c43ca6cbb0b06e3 - name: Merge dbgate/dbgate-pro run: | mkdir ../dbgate-pro diff --git a/.github/workflows/build-docker-pro.yaml b/.github/workflows/build-docker-pro.yaml index 1da09a70a..ce4f5b724 100644 --- a/.github/workflows/build-docker-pro.yaml +++ b/.github/workflows/build-docker-pro.yaml @@ -44,7 +44,7 @@ jobs: repository: dbgate/dbgate-pro token: '${{ secrets.GH_TOKEN }}' path: dbgate-pro - ref: a2f824dc711b510a5e8235d3faf4aafab1965184 + ref: ca1a1664e4c45945d7afe9534c43ca6cbb0b06e3 - name: Merge dbgate/dbgate-pro run: | mkdir ../dbgate-pro diff --git a/.github/workflows/build-npm-pro.yaml b/.github/workflows/build-npm-pro.yaml index fc876f443..fb417cfb2 100644 --- a/.github/workflows/build-npm-pro.yaml +++ b/.github/workflows/build-npm-pro.yaml @@ -32,7 +32,7 @@ jobs: repository: dbgate/dbgate-pro token: '${{ secrets.GH_TOKEN }}' path: dbgate-pro - ref: a2f824dc711b510a5e8235d3faf4aafab1965184 + ref: ca1a1664e4c45945d7afe9534c43ca6cbb0b06e3 - name: Merge dbgate/dbgate-pro run: | mkdir ../dbgate-pro diff --git a/.github/workflows/e2e-pro.yaml b/.github/workflows/e2e-pro.yaml index 9e3378751..83113cce2 100644 --- a/.github/workflows/e2e-pro.yaml +++ b/.github/workflows/e2e-pro.yaml @@ -26,7 +26,7 @@ jobs: repository: dbgate/dbgate-pro token: '${{ secrets.GH_TOKEN }}' path: dbgate-pro - ref: a2f824dc711b510a5e8235d3faf4aafab1965184 + ref: ca1a1664e4c45945d7afe9534c43ca6cbb0b06e3 - name: Merge dbgate/dbgate-pro run: | mkdir ../dbgate-pro diff --git a/workflow-templates/includes.tpl.yaml b/workflow-templates/includes.tpl.yaml index e3fe63593..61336d79a 100644 --- a/workflow-templates/includes.tpl.yaml +++ b/workflow-templates/includes.tpl.yaml @@ -7,7 +7,7 @@ checkout-and-merge-pro: repository: dbgate/dbgate-pro token: ${{ secrets.GH_TOKEN }} path: dbgate-pro - ref: a2f824dc711b510a5e8235d3faf4aafab1965184 + ref: ca1a1664e4c45945d7afe9534c43ca6cbb0b06e3 - name: Merge dbgate/dbgate-pro run: | mkdir ../dbgate-pro From 737436d7e7503170205b512501abaaafecd2b8af Mon Sep 17 00:00:00 2001 From: "SPRINX0\\prochazka" Date: Mon, 10 Feb 2025 15:23:32 +0100 Subject: [PATCH 4/4] fix --- e2e-tests/cypress/e2e/browse-data.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-tests/cypress/e2e/browse-data.cy.js b/e2e-tests/cypress/e2e/browse-data.cy.js index 18bc8e586..520ab8367 100644 --- a/e2e-tests/cypress/e2e/browse-data.cy.js +++ b/e2e-tests/cypress/e2e/browse-data.cy.js @@ -350,7 +350,7 @@ describe('Data browser data', () => { cy.themeshot('comparesettings'); }); - it.only('Query editor - AI assistant', () => { + it('Query editor - AI assistant', () => { cy.contains('MySql-connection').click(); cy.contains('MyChinook').click(); cy.testid('TabsPanel_buttonNewQuery').click();