Skip to content

Commit

Permalink
rename workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo committed Jan 17, 2025
1 parent eeafec5 commit 35e8e3d
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 45 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/a.yml

This file was deleted.

74 changes: 74 additions & 0 deletions .github/workflows/pit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Run PiT
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: false
type: string
starters:
description: 'Starters to run, separated by comma'
required: true
default: 'control-center'
type: string
skipcurrent:
description: 'Skip running tests in current version'
required: false
type: boolean
default: false
skipdev:
description: 'Skip running tests in dev mode'
required: false
type: boolean
default: false
debug:
description: 'Be verbose when running PiT steps'
required: false
type: boolean
default: false
push:
jobs:
run:
runs-on: ubuntu-latest
services:
docker:
image: docker:dind
options: --privileged --shm-size=2g
steps:
- name: Check out branch
uses: actions/checkout@v4
- if: ${{ env.ACT }}
name: ACT - install dependencies
run: |
echo "export PATH='$PATH'" > path.sh
apt-get update
apt-get install -y vim iputils-ping sudo unzip wget jq curl
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Set up Helm
uses: azure/[email protected]
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
with:
install_only: false
- name: Run PiT
env:
CC_KEY: ${{ secrets.CC_KEY }}
CC_CERT: ${{ secrets.CC_CERT }}
run: |
[ -n "${{ inputs.skipcurrent }}" ] && A="$A --skip-current"
[ -n "${{ inputs.skipdev }}" ] && A="$A --skip-dev"
[ -n "${{ inputs.debug }}" ] && A="$A --debug"
[ -n "${{ inputs.version }}" ] && A="$A --version=${{ inputs.version }}"
./scripts/pit/run.sh --starter=${{inputs.starters}} $A
- if: ${{ always()}}
uses: actions/upload-artifact@v4
with:
name: outputs
path: tmp/**/*.out
if-no-files-found: ignore
retention-days: 2



8 changes: 5 additions & 3 deletions scripts/pit/its/cc-install-apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ const log = s => process.stderr.write(` ${s}`);
const screenshots = "screenshots.out"
let sscount = 0;
async function takeScreenshot(page, name) {
const path = `${screenshots}/${++sscount}-${name}.png`;
var scr = path.basename(__filename);
const file = `${screenshots}/${scr}-${++sscount}-${name}.png`;
await page.waitForTimeout(1000);
await page.screenshot({ path });
log(`Screenshot taken: ${path}\n`);
await page.screenshot({ path: file });
log(`Screenshot taken: ${file}\n`);
}


(async () => {
const browser = await chromium.launch({
headless: headless,
Expand Down
8 changes: 5 additions & 3 deletions scripts/pit/its/cc-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const {chromium} = require('playwright');
const { expect } = require('@playwright/test');
const { exec } = require('child_process');
const promisify = require('util').promisify;
const path = require('path');

const log = s => process.stderr.write(` ${s}`);
const run = async cmd => (await promisify(exec)(cmd)).stdout;
Expand Down Expand Up @@ -37,10 +38,11 @@ if (!email) {
const screenshots = "screenshots.out"
let sscount = 0;
async function takeScreenshot(page, name) {
const path = `${screenshots}/${++sscount}-${name}.png`;
var scr = path.basename(__filename);
const file = `${screenshots}/${scr}-${++sscount}-${name}.png`;
await page.waitForTimeout(1000);
await page.screenshot({ path });
log(`Screenshot taken: ${path}\n`);
await page.screenshot({ path: file });
log(`Screenshot taken: ${file}\n`);
}

(async () => {
Expand Down

0 comments on commit 35e8e3d

Please sign in to comment.