feat(api): add Athena workgroups and a query editor to the cloud explorer
CI / checks (pull_request) Successful in 28m25s
CI / checks (pull_request) Successful in 28m25s
Create and delete Athena workgroups (with a result folder, optionally enforced), and run SQL in one: pick a database from the Glue Data Catalog, preview a table, run with Ctrl+Enter, cancel a running query, read up to 1,000 rows and download the full result CSV from S3. Recent queries in the workgroup can be reopened. TheCloud runs the SQL for real over the files a Glue table points at. The Glue page links to the editor.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {QueryClient, QueryClientProvider} from '@tanstack/react-query'
|
||||
import {render, screen, within} from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import {MemoryRouter} from 'react-router-dom'
|
||||
import {beforeEach, expect, test, vi} from 'vitest'
|
||||
import {DataCatalogPanel} from './DataCatalogPanel'
|
||||
import type {CloudResource} from '@/types/resource'
|
||||
@@ -24,7 +25,7 @@ function database(tables: unknown[] = [{
|
||||
function renderPanel(resource: CloudResource) {
|
||||
api.getCloudResource.mockResolvedValue(resource)
|
||||
const client = new QueryClient({defaultOptions: {queries: {retry: false}}})
|
||||
return render(<QueryClientProvider client={client}><DataCatalogPanel resource={resource} runtimeReachable/></QueryClientProvider>)
|
||||
return render(<MemoryRouter><QueryClientProvider client={client}><DataCatalogPanel resource={resource} runtimeReachable/></QueryClientProvider></MemoryRouter>)
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -40,6 +41,7 @@ test('lists tables with their format, location and columns', async () => {
|
||||
expect(within(row).getByText('s3://data/orders/')).toBeInTheDocument()
|
||||
expect(within(row).getByText('semicolon-separated, header row')).toBeInTheDocument()
|
||||
expect(within(row).getByText('amount')).toBeInTheDocument()
|
||||
expect(screen.getByRole('link', {name: 'Query in Athena'})).toHaveAttribute('href', '/cloud-explorer/aws/query')
|
||||
})
|
||||
|
||||
test('creates a CSV table from the columns entered', async () => {
|
||||
|
||||
Reference in New Issue
Block a user