Skip to content

Commit

Permalink
add test for clone
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvaingaudan committed Oct 24, 2024
1 parent 19924bb commit 4d4780b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions arlas/cli/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def data(
Service.index_hits(config, index=index, file_path=file, bulk_size=bulk, count=count)
i = i + 1


@indices.command(help="Generate the mapping based on the data")
def mapping(
file: str = typer.Argument(help="Path to the file conaining the data. Format: NDJSON"),
Expand Down
2 changes: 1 addition & 1 deletion arlas/cli/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def list_collections(arlas: str) -> list[list[str]]:
])
return table

def list_indices(arlas: str, keeponly: None) -> list[list[str]]:
def list_indices(arlas: str, keeponly: str = None) -> list[list[str]]:
data = json.loads(Service.__es__(arlas, "_cat/indices?format=json"))
table = [["name", "status", "count", "size"]]
for index in data:
Expand Down
9 changes: 9 additions & 0 deletions scripts/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ else
exit 1
fi

# ----------------------------------------------------------
echo "TEST clone index"
if python3.10 -m arlas.cli.cli --config-file /tmp/arlas_cli.yaml indices --config tests clone courses courses2 | grep courses | grep " 200 "; then
echo "OK: hundred hits found"
else
echo "ERROR: hits not found"
exit 1
fi


# ----------------------------------------------------------
echo "TEST add collection"
Expand Down

0 comments on commit 4d4780b

Please sign in to comment.