Skip to content

Commit

Permalink
Tweak CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiddis committed Apr 12, 2023
1 parent 082a3fc commit fdbfaa3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Python Poetry CI
name: Python CI
on: pull_request

jobs:
ci:
pytest:
strategy:
fail-fast: false
matrix:
Expand All @@ -15,9 +15,11 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2
- name: Install dependencies
working-directory: ./scripts/integrations-cli
run: pip install -r requirements.txt
- uses: abatilo/pytest-action@v2
name: Run pytest
working-directory: ./scripts/integrations-cli
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Run Integrations CLI unit tests
run: cd scripts/integrations-cli && poetry install && poetry run python -m unittest
job-summary: false
8 changes: 4 additions & 4 deletions scripts/integrations-cli/integrations_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import helpers

available_templates = {
"http": "template-dashboards/http.ndjson"
"log": "template-dashboards/logs.ndjson"
}


Expand All @@ -25,11 +25,11 @@ def do_add_component(builder: helpers.IntegrationBuilder) -> bool:
manager = helpers.CatalogManager()
choices = {}
for category in manager.catalog["categories"]:
click.echo(f"- Category {category['category']}")
click.echo(f"- {colored(category['category'], color='light_blue')}")
for component in category["components"]:
desc = component["description"]
desc = desc if len(desc) < 50 else desc[:47] + "..."
click.echo(f" - {component['component']}: {desc}")
click.echo(f" - {colored(component['component'], 'light_yellow')}: {desc}")
choices[component["component"]] = component
component = click.prompt(
"Select component", type=click.Choice(list(choices)), show_choices=False
Expand All @@ -38,7 +38,7 @@ def do_add_component(builder: helpers.IntegrationBuilder) -> bool:
if component in available_templates:
if click.prompt(
f"A pre-made template dashboard for component `{component}` was detected. Include it? (y/n)",
type=click.Choice(["y", "n"]),
type=click.Choice(["y", "n"], False),
show_choices=False
) == "y":
builder.with_dashboard(available_templates[component])
Expand Down

0 comments on commit fdbfaa3

Please sign in to comment.