Skip to content

Adding the releases-graph app #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ Use: ./scripts/pit/run.sh with the next options:
--skip-prod Skip production validations
--skip-dev Skip dev-mode validations
--skip-clean Do not clean maven cache
--skip-helm Do not re-install control-center with helm and continue running tests
--skip-helm Do not re-install control-center with helm and continue running tests, implies (--offline, --skip-build, --keep-cc)
--skip-pw Do not run playwright tests
--cluster=name Run tests in an existing k8s cluster
--vendor=name Use a specific cluster vendor to run control-center tests options: [dd, kind, do] (default: kind)
--keep-cc Keep control-center running after tests
--proxy-cc Forward port 443 from k8s cluster to localhost
--events-cc Display events from control-center
--skip-build Skip building the docker images for control-center
--delete-cluster Delete the cluster/s
--dashboard=* Install kubernetes dashboard, options [install, uninstall] (default: install)
--pnpm Use pnpm instead of npm to speed up frontend compilation (default npm)
Expand Down Expand Up @@ -110,6 +111,8 @@ Use: ./scripts/pit/run.sh with the next options:
· form-filler-demo
· flow-hilla-hybrid-example
· designer-tutorial
· walking-skeleton:v24.7-hybrid
· releases-graph
```


Expand Down
32 changes: 32 additions & 0 deletions scripts/pit/its/releases.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const { expect} = require('@playwright/test');
const {log, args, createPage, closePage, takeScreenshot, waitForServerReady} = require('./test-utils');

(async () => {
const arg = args();

const page = await createPage(arg.headless, arg.ignoreHTTPSErrors);

await waitForServerReady(page, arg.url);

await page.locator('html').first().innerHTML();
await takeScreenshot(page, __filename, 'view1-loaded');
await expect(page.getByText('Pre-releases per version').first()).toBeVisible();

await page.getByText('by release count').click();

await takeScreenshot(page, __filename, 'view3-loaded');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could probably add tests for the two time span graphs as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not testing the app here, the app has it's own IT, probably that part might be improved because coverage is not complete, it was taken from the ui-test-generator AI output.

In pit normally we do tests that demonstrate that migrating the app to a new version it seems working.

await expect(page.getByText('Releases per version').first()).toBeVisible();

if (arg.version && arg.version !== 'current') {
const [major, minor] = arg.version.split('.');
const labelRegex = new RegExp(`${major}\\.${minor}, `);
await page.getByLabel(labelRegex).click();
await expect(page.getByLabel('Interactive chart').locator('text').getByText(arg.version)).toBeVisible();

await page.getByText(arg.version).first().click();
await expect(page.getByRole('heading', { name: `Release Notes for ${arg.version}` })).toBeVisible();
}

log(JSON.stringify(arg));
await closePage(page);
})();
9 changes: 8 additions & 1 deletion scripts/pit/its/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ function ok(...args) {
function warn(...args) {
process.stderr.write(`\x1b[2m\x1b[91m${args}\x1b[0m`);
}
let lastErr;
function err(...args) {
process.stderr.write(`\x1b[0;31m${args}\x1b[0m`.split('\n')[0] + '\n');
// out(args);
const str = `${args.toString().split('\n').slice(1).join('\n')}`;
if (str !== lastErr) {
out(str);
lastErr = str;
}
}

const run = async (cmd) => (await promisify(exec)(cmd)).stdout;
Expand Down Expand Up @@ -71,6 +76,8 @@ const args = () => {
ret.tag = a.split('=')[1];
} else if (/^--secret/.test(a)) {
ret.secret = a.split('=')[1];
} else if (/^--version/.test(a)) {
ret.version = a.split('=')[1];
}
});
if (!ret.url) {
Expand Down
4 changes: 2 additions & 2 deletions scripts/pit/lib/lib-args.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Use: $0 with the next options:
--skip-prod Skip production validations
--skip-dev Skip dev-mode validations
--skip-clean Do not clean maven cache
--skip-helm Do not re-install control-center with helm and continue running tests
--skip-helm Do not re-install control-center with helm and continue running tests, implies (--offline, --skip-build, --keep-cc)
--skip-pw Do not run playwright tests
--cluster=name Run tests in an existing k8s cluster
--vendor=name Use a specific cluster vendor to run control-center tests options: [dd, kind, do] (default: kind)
Expand Down Expand Up @@ -83,7 +83,7 @@ checkArgs() {
--skip-pw) SKIPPW=true;;
--cluster=*) CLUSTER="$arg";;
--vendor=*) VENDOR="$arg";;
--skip-helm) SKIPHELM=true;;
--skip-helm) SKIPHELM=true; SKIPBUILD=true; OFFLINE=true; KEEPCC=true ;;
--skip-build) SKIPBUILD=true;;
--keep-cc) KEEPCC=true;;
--pnpm) PNPM="-Dpnpm.enable=true";;
Expand Down
1 change: 1 addition & 0 deletions scripts/pit/lib/lib-demos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ getTest() {
mpr-demo) echo "mpr-demo.js";;
spreadsheet-demo) echo "spreadsheet-demo.js";;
k8s-demo-app) echo "k8s-demo.js";;
releases-graph) echo "releases.js";;
cookbook|walking-skeleton*|business-app-starter-flow|*hilla*|spring-petclinic-vaadin-flow|gs-crud-with-vaadin|vaadin-form-example|vaadin-rest-example|vaadin-localization-example|vaadin-database-example|layout-examples|flow-quickstart-tutorial|flow-spring-examples|flow-crm-tutorial|layout-examples|flow-quickstart-tutorial|vaadin-oauth-example|designer-tutorial|*addon-template|addon-starter-flow|testbench-demo) echo "noop.js";;
start) echo "start-wizard.js";;
vaadin-oauth-example) echo "oauth.js";;
Expand Down
2 changes: 1 addition & 1 deletion scripts/pit/lib/lib-validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ runValidations() {

# 11
if [ -z "$SKIPTESTS" -a -z "$SKIPPW" ]; then
runPlaywrightTests "$test" "$file" "$mode" "$name" "--port=$port" || return 1
runPlaywrightTests "$test" "$file" "$mode" "$name" "--port=$port" "--version=$version" || return 1
fi

# 12
Expand Down
1 change: 1 addition & 0 deletions scripts/repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ form-filler-demo
flow-hilla-hybrid-example
designer-tutorial
walking-skeleton:v24.7-hybrid
releases-graph
"

## Not needed so far since the hybrid should cover all the views
Expand Down