Skip to content

Commit

Permalink
Adding unit test for configuration CLI command and documentation for …
Browse files Browse the repository at this point in the history
…the same

Signed-off-by: ShaktidharK1997 <shaktidhark.1997@gmail.com>
  • Loading branch information
ShaktidharK1997 committed Feb 11, 2025
1 parent 2358d5f commit 9a68d73
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/reference/feast-cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Options:
Commands:
apply Create or update a feature store deployment
configuration Display Feast configuration
entities Access entities
feature-views Access feature views
init Create a new Feast repository
Expand Down Expand Up @@ -61,6 +62,28 @@ feast apply
`feast apply` \(when configured to use cloud provider like `gcp` or `aws`\) will create cloud infrastructure. This may incur costs.
{% endhint %}

## Configuration

Display the actual configuration being used by Feast, including both user-provided configurations and default configurations applied by Feast.

```bash
feast configuration
```

```yaml
project: foo
registry: data/registry.db
provider: local
online_store:
type: sqlite
path: data/online_store.db
offline_store:
type: dask
entity_key_serialization_version: 2
auth:
type: no_auth
```
## Entities
List all registered entities
Expand Down
20 changes: 20 additions & 0 deletions sdk/python/tests/unit/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,23 @@ def setup_third_party_registry_store_repo(
)

yield repo_path


def test_cli_configuration():
"""
Unit test for the 'feast configuration' command
"""
runner = CliRunner()

with setup_third_party_provider_repo("local") as repo_path:
# Run the 'feast configuration' command
return_code, output = runner.run_with_output(["configuration"], cwd=repo_path)

# Assertions
assertpy.assert_that(return_code).is_equal_to(0)
assertpy.assert_that(output).contains(b"project: foo")
assertpy.assert_that(output).contains(b"provider: local")
assertpy.assert_that(output).contains(b"type: sqlite")
assertpy.assert_that(output).contains(b"path: data/online_store.db")
assertpy.assert_that(output).contains(b"type: file")
assertpy.assert_that(output).contains(b"entity_key_serialization_version: 2")

0 comments on commit 9a68d73

Please sign in to comment.