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

feat(firebolt): Automatically start the engine after connection #9001

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

stepansergeevitch
Copy link

@stepansergeevitch stepansergeevitch commented Nov 27, 2024

Check List

  • Tests has been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Issue Reference this PR resolves

We've received a support ticket that a customer cannot connect to a stopped engine

Description of Changes Made (if issue reference is not provided)

  • Added engine autostart to ensure we can connect to a stopped engine
  • Added a verbose user message when testing connection fails

@stepansergeevitch stepansergeevitch requested a review from a team as a code owner November 27, 2024 13:12
Copy link

vercel bot commented Nov 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-angular-dashboard ⬜️ Ignored (Inspect) Visit Preview Nov 27, 2024 1:12pm
examples-react-d3 ⬜️ Ignored (Inspect) Visit Preview Nov 27, 2024 1:12pm
examples-react-dashboard ⬜️ Ignored (Inspect) Visit Preview Nov 27, 2024 1:12pm
examples-react-data-table ⬜️ Ignored (Inspect) Visit Preview Nov 27, 2024 1:12pm
examples-react-highcharts ⬜️ Ignored (Inspect) Visit Preview Nov 27, 2024 1:12pm
examples-react-material-ui ⬜️ Ignored (Inspect) Visit Preview Nov 27, 2024 1:12pm
examples-react-pivot-table ⬜️ Ignored (Inspect) Visit Preview Nov 27, 2024 1:12pm
examples-vue-query-builder ⬜️ Ignored (Inspect) Visit Preview Nov 27, 2024 1:12pm

@github-actions github-actions bot added the pr:community Contribution from Cube.js community members. label Nov 27, 2024
Copy link
Member

@KSDaemon KSDaemon left a comment

Choose a reason for hiding this comment

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

👍🏻 Great! Thanks for the contribution!

@KSDaemon
Copy link
Member

KSDaemon commented Dec 2, 2024

@stepansergeevitch Do unit tests work for you? I tried the yarn run test and saw that they failed. I wonder if your newly added test works. %)

 FAIL  dist/test/autostart.test.js (7.08 s)
  ● FireboltDriver autostart › calls engine start

    TypeError: Cannot read properties of undefined (reading 'includes')

      85 |
      86 |     const username = getEnv('dbUser', { dataSource });
    > 87 |     const auth = username.includes('@')
         |                           ^
      88 |       ? { username, password: getEnv('dbPass', { dataSource }) }
      89 |       : { client_id: username, client_secret: getEnv('dbPass', { dataSource }) };
      90 |

      at new FireboltDriver (src/FireboltDriver.ts:87:27)
      at test/autostart.test.ts:15:14

@stepansergeevitch
Copy link
Author

stepansergeevitch commented Dec 2, 2024

@stepansergeevitch Do unit tests work for you? I tried the yarn run test and saw that they failed. I wonder if your newly added test works. %)

 FAIL  dist/test/autostart.test.js (7.08 s)
  ● FireboltDriver autostart › calls engine start

    TypeError: Cannot read properties of undefined (reading 'includes')

      85 |
      86 |     const username = getEnv('dbUser', { dataSource });
    > 87 |     const auth = username.includes('@')
         |                           ^
      88 |       ? { username, password: getEnv('dbPass', { dataSource }) }
      89 |       : { client_id: username, client_secret: getEnv('dbPass', { dataSource }) };
      90 |

      at new FireboltDriver (src/FireboltDriver.ts:87:27)
      at test/autostart.test.ts:15:14

Hey @KSDaemon
This test actually requires you to set the env variables for the driver.
Specifiсally CUBEJS_DB_USER, CUBEJS_DB_PASS, CUBEJS_DB_NAME, CUBEJS_FIREBOLT_ACCOUNT and CUBEJS_FIREBOLT_ENGINE_NAME
So that it's able to connect to the database

@KSDaemon
Copy link
Member

KSDaemon commented Dec 3, 2024

@stepansergeevitch Thnx for the notes! I see... So it's kind of impossible to setup isolated unit/integration tests. Anyway it requires cloud account/connection....

@KSDaemon
Copy link
Member

KSDaemon commented Dec 3, 2024

@stepansergeevitch, Could you please add a console.log message at the beginning of the test suite saying that it is required to set up all those ENVs if some of the required ones are missing? This will help future contributors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:community Contribution from Cube.js community members.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants