From 88d227e8e81d5187d049a9423ad2dfc93e4f74b1 Mon Sep 17 00:00:00 2001 From: Matteo Silvestri Date: Thu, 28 Jul 2022 17:08:38 +0200 Subject: [PATCH] only run if CI=true and delete kind command to clean workspace Signed-off-by: Matteo Silvestri --- .github/workflows/ci.yml | 5 ++++- .../src/util/KubernetesContainerRunner.test.ts | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d886cddf8..85c279a481 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,7 +195,7 @@ jobs: - name: lint run: yarn backstage-cli repo lint --since origin/master - + - name: bootstrap kind run: | curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.14.0/kind-linux-amd64 @@ -224,6 +224,9 @@ jobs: BACKSTAGE_TEST_DATABASE_POSTGRES9_CONNECTION_STRING: postgresql://postgres:postgres@localhost:${{ job.services.postgres9.ports[5432] }} BACKSTAGE_TEST_DATABASE_MYSQL8_CONNECTION_STRING: mysql://root:root@localhost:${{ job.services.mysql8.ports[3306] }}/ignored + - name: delete kind command + run: rm kind + - name: ensure clean working directory run: | if files=$(git ls-files --exclude-standard --others --modified) && [[ -z "$files" ]]; then diff --git a/packages/backend-common/src/util/KubernetesContainerRunner.test.ts b/packages/backend-common/src/util/KubernetesContainerRunner.test.ts index 6b5b8df67e..f8f21dd062 100644 --- a/packages/backend-common/src/util/KubernetesContainerRunner.test.ts +++ b/packages/backend-common/src/util/KubernetesContainerRunner.test.ts @@ -25,13 +25,12 @@ import { } from './KubernetesContainerRunner'; import { RunContainerOptions } from './ContainerRunner'; import { PassThrough } from 'stream'; -import { isDockerDisabledForTests } from '@backstage/backend-test-utils'; -const describeIfDocker = isDockerDisabledForTests() ? describe.skip : describe; +const describeIfCI = Boolean(process.env.CI) ? describe : describe.skip; jest.setTimeout(10 * 1000); -describeIfDocker('KubernetesContainerRunner', () => { +describeIfCI('KubernetesContainerRunner', () => { const kubeConfig = new KubeConfig(); kubeConfig.loadFromDefault(); const name = 'kube-runner';