diff --git a/.github/workflows/python-poetry.yml b/.github/workflows/python-ci.yml similarity index 54% rename from .github/workflows/python-poetry.yml rename to .github/workflows/python-ci.yml index acebc5421..2990dd2f4 100644 --- a/.github/workflows/python-poetry.yml +++ b/.github/workflows/python-ci.yml @@ -1,8 +1,8 @@ -name: Python Poetry CI +name: Python CI on: pull_request jobs: - ci: + pytest: strategy: fail-fast: false matrix: @@ -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 \ No newline at end of file + job-summary: false diff --git a/scripts/integrations-cli/integrations_cli/main.py b/scripts/integrations-cli/integrations_cli/main.py index 3dd2f4137..38aadb797 100644 --- a/scripts/integrations-cli/integrations_cli/main.py +++ b/scripts/integrations-cli/integrations_cli/main.py @@ -11,7 +11,7 @@ import helpers available_templates = { - "http": "template-dashboards/http.ndjson" + "log": "template-dashboards/logs.ndjson" } @@ -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 @@ -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]) diff --git a/scripts/integrations-cli/template-dashboards/http.ndjson b/scripts/integrations-cli/template-dashboards/logs.ndjson similarity index 100% rename from scripts/integrations-cli/template-dashboards/http.ndjson rename to scripts/integrations-cli/template-dashboards/logs.ndjson