Commit Graph

15 Commits

Author SHA1 Message Date
Stefano Magni
f24ef6ced5 console(fix, plaftorm): Fix the E2E tests lint process
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6550
GitOrigin-RevId: ff31b5990fc1d27e64346289a13e0dadab7883ea
2022-10-31 14:00:51 +00:00
Stefano Magni
5764174087 test(console): Skip a lot of flaky E2E tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5535
GitOrigin-RevId: 0544edf4d8fdd1a6a8cc326a8b107ee47d2389c3
2022-08-31 08:02:51 +00:00
Stefano Magni
e8cb480b13 test(platform): Add a script to automatically export the E2E test request and responses
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5386
GitOrigin-RevId: 5458dadc7a23f82a1b344fcd19d8c431d6bd8c78
2022-08-10 13:44:37 +00:00
Varun Choudhary
69d4d8c6df console: e2e test for graphql customization while adding data source
Use this docker-compose file while running the connect DB cypress test

<details>
<summary>Docker-compose file</summary>

```yaml
version: '3.6'
services:
  postgres:
    image: postgres:12
    restart: unless-stopped
    ports:
      - '5432:5432'
    volumes:
      - db_meta:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: postgrespassword
  postgres12:
    image: postgres:12
    restart: unless-stopped
    ports:
      - '4432:5432'
    volumes:
      - db_pg12_data:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: postgrespassword
  msserver:
    image: 'mcr.microsoft.com/mssql/server:2019-latest'
    ports:
      - '1435:1435'
    restart: unless-stopped
    environment:
      SA_PASSWORD: 'testPassword123'
      ACCEPT_EULA: 'Y'
  graphql-engine:
    image: hasura/graphql-engine:v2.8.1
    ports:
      - '8080:8080'
    depends_on:
      - 'postgres'
    restart: unless-stopped
    environment:
      HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres
      TEST_MSSQL_DATABASE_URL: DRIVER={ODBC Driver 17 for SQL Server};SERVER=msserver;Uid=SA;Pwd=testPassword123
      ## enable the console served by server
      HASURA_GRAPHQL_ENABLE_CONSOLE: 'true' # set to "false" to disable console
      ## enable debugging mode. It is recommended to disable this in production
      ## HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: /srv/console-assets
      HASURA_GRAPHQL_DEV_MODE: 'true'
      HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
      ## uncomment next line to set an admin secret
      # HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
      HASURA_GRAPHQL_ENABLE_REMOTE_SCHEMA_PERMISSIONS: 'true'
      HASURA_GRAPHQL_EXPERIMENTAL_FEATURES: naming_convention
volumes:
  db_pg12_data:
  db_meta:
# Connect to second PG using env var DB2
# Connect to metadata PG using HASURA_GRAPHQL_METADATA_DATABASE_URL
# Connect to mssql server using connection string (not env)
# DRIVER={ODBC Driver 17 for SQL Server};SERVER=msserver;Uid=SA;Pwd=testPassword123
# PG 12 : postgres://postgres:postgrespassword@postgres12:5432/postgres
```

</details>

1. Here is the [Video](https://www.loom.com/share/bfe8b4da59ae48dca3fc9877b440c360) of the running connect db e2e test
2. We write test only for connect Postgres DB not for mssql because mssql container doesn't work on CI and on M1 laptops. Moreover, the value provided was low because we tested the same path Postgres (this was team agreement)
3. We installed @testing-library/cypress to leverage the same helper functions (we used `findByText` and `findByPlaceholderText`)
4. We used `withIn` to target a section on a page and find an element inside
5. We used a procedural approach and we added `cy.log` to improve the debugging of the test.
6. We created new helper function to test notifications -

`cy.expectSuccessNotification()`
`cy.expectSuccessNotificationWithTitle(title: string)`
`cy.expectSuccessNotificationWithMessage(message: string)`
`cy.expectErrorNotification()`
`cy.expectErrorNotificationWithTitle(title: string)`
`cy.expectErrorNotificationWithMessage(message: string)`

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4960
Co-authored-by: Luca Restagno <59067245+lucarestagno@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
Co-authored-by: Samir Talwar <47582+SamirTalwar@users.noreply.github.com>
Co-authored-by: Divi <32202683+imperfect-fourth@users.noreply.github.com>
Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
Co-authored-by: Erik Magnusson <32518962+ejkkan@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
Co-authored-by: Jesse Hallett <9622+hallettj@users.noreply.github.com>
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
Co-authored-by: David Overton <7734777+dmoverton@users.noreply.github.com>
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
Co-authored-by: Lyndon Maydwell <92299+sordina@users.noreply.github.com>
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
Co-authored-by: Benoit Ranque <25712958+BenoitRanque@users.noreply.github.com>
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com>
Co-authored-by: Solomon <24038+solomon-b@users.noreply.github.com>
Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
Co-authored-by: Evie Ciobanu <1017953+eviefp@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Daniele Cammareri <5709409+dancamma@users.noreply.github.com>
Co-authored-by: Marion Schleifer <5722022+marionschleifer@users.noreply.github.com>
GitOrigin-RevId: a50879ee790d3409c0b97c87a0e3d2b793c9ff37
2022-07-21 09:31:55 +00:00
Stefano Magni
fc753ffb42 console: Update Cypress to v10 and run the migration guide
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4849
GitOrigin-RevId: 10e0fd62344a0c5c7028ad480b747b7f64c9c773
2022-07-05 08:51:35 +00:00
Stefano Magni
fb1dc2e0ba console: improve actions E2E tests with rest connectors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4520
GitOrigin-RevId: 24d9176dc5f93747e4b3a12ed08171064e75900e
2022-06-28 05:40:36 +00:00
Stefano Magni
717cf4fa86 console: Refactor the Action With Transform E2E tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4519
GitOrigin-RevId: 1bcef6b5525e3bf361000ca1905e04cebe18542a
2022-06-24 13:38:34 +00:00
Stefano Magni
b2103cda61 console: Refactoring the Mutation Actions-related E2E tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4482
GitOrigin-RevId: bd628911e607ab41399b31f7dd8fe9c361e0f052
2022-06-17 14:07:16 +00:00
Stefano Magni
d769800086 console: Halt collecting the E2E tests code coverage CON-203
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4510
GitOrigin-RevId: 2fff40627278e6e8eb48bc4d466ce499e7669ca7
2022-06-16 16:18:26 +00:00
Ikechukwu Eze
6bb8df6a26 console: add citus support
### Description
Add console support for Citus DB

### Changelist
- [x] Add/Remove Citus Datasource
- [x] Track/Untrack tables
- [x] Create Relationships + Tracking suggested relationships
- [x] Permissions
- [x] Browse Rows (minimal)
- [x] Insert Row (using Mutations)
- [x] Filtering Shards and Partitions (partition details are not present in Modify tab, it should work once https://github.com/hasura/graphql-engine-mono/pull/1164 is merged)
- [x] Create Table
- [x] Fixes issue https://github.com/hasura/graphql-engine/issues/6926 for Citus.

### Known Issues
- Unable to create Functions from Raw SQL, server returns 400.
- Unable to run `ALTER` SQL commands, server returns 400.

### Screenshots

![Screenshot 2021-04-21 at 7 53 23 PM](https://user-images.githubusercontent.com/11921040/115569900-468b3d80-a2db-11eb-8374-e06d5d61b2e4.png)

### Setting up a Citus Source
- Link to [docker compose](https://github.com/citusdata/docker/blob/master/docker-compose.yml)
- Create an `.envfile` and add the following
```env
COORDINATOR_EXTERNAL_PORT=<port to expose citus master>
COMPOSE_PROJECT_NAME=test
```
- run `docker-compose --file docker-compose.yml --env-file .envfile up --scale worker=2 -d`. `worker` controls the number of citus worker nodes.
- Link to [sample data](http://docs.citusdata.com/en/v10.0/get_started/tutorial_multi_tenant.html#data-model-and-sample-data)

### Changelog
- [x] console: add citus support

https://github.com/hasura/graphql-engine-mono/pull/1184

Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 2500a5d5f996a2904fe8b5c656d6f3f2db707db6
2021-06-21 06:47:18 +00:00
Aleksandra Sikora
8c21ca5d21 console: revert improve data/relationships e2e tests
The changes turned out to be flaky — tests were failing from time to time, and blocking other PRs from being merged.

Reverts hasura/graphql-engine-mono#1037

GitOrigin-RevId: 97d95156e8d348f2e89ec33e06ffaac9bf75a2f9
2021-05-12 07:37:45 +00:00
Ikechukwu Eze
d3887071af console: improve data/relationships e2e tests
This is the first step in making our cypress test faster.
Will clean the comments up in the coming days
Running time imporves from ~7mins to ~83secs

GitOrigin-RevId: d8d2b23c5a46789a3828dac1c6652034bd0bfc1c
2021-05-06 10:20:44 +00:00
Varun Choudhary
845756047a console: add tests for manage db page
TODO:

- [x] Test for add sources

- [x] Test for set connection setting

- [x] Test for delete sources

- [x] Test for switch between sources

Co-authored-by: Ikechukwu Eze <22247592+iykekings@users.noreply.github.com>
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 2b31dbb69767cdcacf0cb2b2afde56871c3a2240
2021-03-19 09:48:18 +00:00
Raj Anand
1b442fc2dd
console: migrate cypress tests to TypeScript (#4550) 2020-05-27 14:56:29 +05:30
Praveen D
b8bb2d652c add console to graphql-engine 2018-06-28 10:27:37 +05:30