skip if not docker and bootstrap KinD in workflow action

Signed-off-by: Matteo Silvestri <matteosilv@gmail.com>
This commit is contained in:
Matteo Silvestri
2022-07-27 22:12:04 +02:00
parent eadfa6fc45
commit cbf0cbbb98
2 changed files with 14 additions and 3 deletions
+6
View File
@@ -195,6 +195,12 @@ 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
chmod +x ./kind
./kind create cluster
- name: test changed packages
if: ${{ steps.yarn-lock.outcome == 'success' }}
@@ -25,10 +25,13 @@ import {
} from './KubernetesContainerRunner';
import { RunContainerOptions } from './ContainerRunner';
import { PassThrough } from 'stream';
import { isDockerDisabledForTests } from '@backstage/backend-test-utils';
const describeIfDocker = isDockerDisabledForTests() ? describe.skip : describe;
jest.setTimeout(10 * 1000);
describe('KubernetesContainerRunner', () => {
describeIfDocker('KubernetesContainerRunner', () => {
const kubeConfig = new KubeConfig();
kubeConfig.loadFromDefault();
const name = 'kube-runner';
@@ -183,10 +186,12 @@ describe('KubernetesContainerRunner', () => {
});
describe('with namespace test', () => {
const api = kubeConfig.makeApiClient(CoreV1Api);
const authApi = kubeConfig.makeApiClient(RbacAuthorizationV1Api);
let api: CoreV1Api;
let authApi: RbacAuthorizationV1Api;
beforeAll(async () => {
api = kubeConfig.makeApiClient(CoreV1Api);
authApi = kubeConfig.makeApiClient(RbacAuthorizationV1Api);
await api.createNamespace({
metadata: {
name: 'test',