Skip to content

Commit 28bbf7c

Browse files
committed
Fix fleet tracing test
Signed-off-by: Martin Kravec <kravciak@gmail.com>
1 parent 0564a6c commit 28bbf7c

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

tests/e2e/60-telemetry.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Chart, ChartRepo, RancherAppsPage } from './rancher/rancher-apps.page'
33
import { PolicyServersPage } from './pages/policyservers.page'
44
import { TelemetryPage } from './pages/telemetry.page'
55
import { RancherUI } from './components/rancher-ui'
6-
import { AdmissionPoliciesPage } from './pages/policies.page'
6+
import { AdmissionPoliciesPage, Policy } from './pages/policies.page'
77

88
// Cert-Manager
99
const cmanRepo: ChartRepo = { name: 'jetstack', url: 'https://charts.jetstack.io' }
@@ -54,9 +54,10 @@ test.describe('Setup', () => {
5454
}
5555
})
5656

57-
test('Create custom PolicyServer', async({ page }) => {
57+
test('Create custom PolicyServer & Policy', async({ page }) => {
58+
const policy: Policy = { name: 'no-privileged-custom', title: 'Pod Privileged Policy', mode: 'Monitor', server: 'custom-ps' }
5859
await new PolicyServersPage(page).create({ name: 'custom-ps' })
59-
await new AdmissionPoliciesPage(page).create({ name: 'no-privileged-custom', title: 'Pod Privileged Policy', mode: 'Monitor', server: 'custom-ps' })
60+
await new AdmissionPoliciesPage(page).create(policy, { wait: process.env.MODE == 'fleet' })
6061
})
6162
})
6263

tests/e2e/components/kubectl-shell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export class Shell {
195195

196196
@step
197197
async waitPods(options?: { ns?: string, filter?: string, timeout?: number }) {
198-
const ns = options?.ns || '-n cattle-kubewarden-system'
198+
const ns = options?.ns ? `-n ${options.ns}` : '-n cattle-kubewarden-system'
199199

200200
const filter = options?.filter || ''
201201
await this.retry(`kubectl get pods --no-headers ${ns} ${filter} 2>&1 | sed -E '/([0-9]+)[/]\\1\\s+Running|Completed/d' | wc -l | grep -qx 0`, options)

0 commit comments

Comments
 (0)