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

tck test cluster #3266

Merged
merged 8 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 59 additions & 4 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Nebula Graph Test Manual
========================
# Nebula Graph Test Manual

## Usage

Expand Down Expand Up @@ -102,7 +101,7 @@ You can find all nebula test cases in [tck/features](tck/features) and some open

The test cases are organized in feature files and described in gherkin language. The structure of feature file is like following example:

#### Basic Case:
### Basic Case

```gherkin
Feature: Basic match
Expand Down Expand Up @@ -134,7 +133,8 @@ Feature: Basic match
| "serve" | "Cavaliers" |
```

#### Case With an Execution Plan:
### Case With an Execution Plan

```gherkin
Scenario: push edge props filter down
When profiling query:
Expand Down Expand Up @@ -166,6 +166,61 @@ The table in `Then` step must have the first header line even if there's no data

Note that for cases that contain execution plans, it is mandatory to fill the `id` column.

### Case With a New Nebula Cluster

In some special cases, we need to test in a new nebula cluster.

e.g.

```gherkin
Feature: Nebula service termination test
Scenario: Basic termination test
Given a nebulacluster with 1 graphd and 1 metad and 1 storaged
When the cluster was terminated
Then no service should still running after 4s
```

```gherkin
Feature: Example
Scenario: test with disable authorize
Given a nebulacluster with 1 graphd and 1 metad and 1 storaged:
"""
graphd:enable_authorize=false
"""
When executing query:
"""
CREATE USER user1 WITH PASSWORD 'nebula';
CREATE SPACE s1(vid_type=int)
"""
And wait 3 seconds
Then the execution should be successful
When executing query:
"""
GRANT ROLE god on s1 to user1
"""
Then the execution should be successful

Scenario: test with enable authorize
Given a nebulacluster with 1 graphd and 1 metad and 1 storaged:
"""
graphd:enable_authorize=true
"""
When executing query:
"""
CREATE USER user1 WITH PASSWORD 'nebula';
CREATE SPACE s1(vid_type=int)
"""
And wait 3 seconds
Then the execution should be successful
When executing query:
"""
GRANT ROLE god on s1 to user1
"""
Then an PermissionError should be raised at runtime: No permission to grant/revoke god user.
```

It would install a new nebula cluster, and create a session to connect this cluster.

### Format

In order to check your changed files for reviewers conveniently, please format your feature file before creating pull request. Try following command to do that:
Expand Down
1 change: 1 addition & 0 deletions tests/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
_curr_path = Path(os.path.dirname(os.path.abspath(__file__)))

NEBULA_HOME = _curr_path.parent.parent
BUILD_DIR = os.path.join(NEBULA_HOME, 'build')
TMP_DIR = os.path.join(_curr_path.parent, '.pytest')
NB_TMP_PATH = os.path.join(TMP_DIR, 'nebula')
SPACE_TMP_PATH = os.path.join(TMP_DIR, 'spaces')
Loading