Skip to content

Commit

Permalink
docs: add a note about accessing the dev env's postgres database (apa…
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Jan 15, 2025
1 parent f235787 commit aacfe4d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
11 changes: 11 additions & 0 deletions docs/docs/contributing/development.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ For more env vars that affect your configuration, see this
[superset_config.py](https://github.com/apache/superset/blob/master/docker/pythonpath_dev/superset_config.py)
used in the `docker compose` context to assign env vars to the superset configuration.

### Accessing the postgres database
Sometimes it's useful to access the database in the docker container directly.
You can enter a `psql` shell (the official Postgres client) by running the following command:

```bash
docker compose exec db psql -U superset
```

Also note that the database is exposed on port 5432, so you can connect to it using your favorite
Postgres client or even SQL Lab itselft directly in Superset by creating a new database connection
to `localhost:5432`.

### Nuking the postgres database

Expand Down
18 changes: 14 additions & 4 deletions superset-frontend/src/features/home/EmptyState.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ describe('EmptyState', () => {
tableName: WelcomeTable.Recents,
},
];

variants.forEach(variant => {
it(`it renders an ${variant.tab} ${variant.tableName} empty state`, () => {
it(`renders an ${variant.tab} ${variant.tableName} empty state`, () => {
const wrapper = mount(<EmptyState {...variant} />);
expect(wrapper).toExist();
const textContainer = wrapper.find('.ant-empty-description');

// Select the first description node
const textContainer = wrapper.find('.ant-empty-description').at(0);
expect(textContainer.text()).toEqual(
variant.tab === TableTab.Favorite
? "You don't have any favorites yet!"
Expand All @@ -79,12 +82,19 @@ describe('EmptyState', () => {
expect(wrapper.find('button')).toHaveLength(1);
});
});

recents.forEach(recent => {
it(`it renders a ${recent.tab} ${recent.tableName} empty state`, () => {
it(`renders a ${recent.tab} ${recent.tableName} empty state`, () => {
const wrapper = mount(<EmptyState {...recent} />);
expect(wrapper).toExist();
const textContainer = wrapper.find('.ant-empty-description');

// Select the first description node
const textContainer = wrapper.find('.ant-empty-description').at(0);

// Validate the image
expect(wrapper.find('.ant-empty-image').children()).toHaveLength(1);

// Check the correct text is displayed
expect(textContainer.text()).toContain(
`Recently ${recent.tab?.toLowerCase()} charts, dashboards, and saved queries will appear here`,
);
Expand Down

0 comments on commit aacfe4d

Please sign in to comment.