-
Notifications
You must be signed in to change notification settings - Fork 14
Add lint, i18n and unit tests to CI pipeline #63
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
Open
kyoto
wants to merge
2
commits into
openshift:main
Choose a base branch
from
kyoto:add-lint-integration-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+296
−174
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
85 changes: 85 additions & 0 deletions
85
.tekton/integration-tests/lightspeed-agentic-console-pre-commit.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| --- | ||
| apiVersion: tekton.dev/v1beta1 | ||
| kind: Pipeline | ||
| metadata: | ||
| name: lightspeed-agentic-console-pre-commits | ||
| spec: | ||
| description: | | ||
| This pipeline runs pre-commit checks for OpenShift Lightspeed Agentic Console. | ||
| params: | ||
| - name: SNAPSHOT | ||
| description: 'The JSON string representing the snapshot of the application under test.' | ||
| default: '{"components": [{"name":"test-app", "containerImage": "quay.io/example/repo:latest", "source": {"git": {"revision": "main"}}}]}' | ||
| - name: test-name | ||
| description: 'The name of the test corresponding to a defined Konflux integration test.' | ||
| default: 'lightspeed-agentic-console-pre-commits' | ||
| tasks: | ||
| - name: extract-snapshot-metadata | ||
| description: Extract console image and commit from SNAPSHOT input | ||
| params: | ||
| - name: SNAPSHOT | ||
| value: $(params.SNAPSHOT) | ||
| taskSpec: | ||
| results: | ||
| - name: console-image | ||
| value: "$(steps.get-snapshot-images.results.console-image)" | ||
| - name: commit | ||
| value: "$(steps.get-snapshot-images.results.commit)" | ||
| params: | ||
| - name: SNAPSHOT | ||
| steps: | ||
| - name: get-snapshot-images | ||
| image: registry.redhat.io/openshift4/ose-cli:latest | ||
| env: | ||
| - name: SNAPSHOT | ||
| value: $(params.SNAPSHOT) | ||
| results: | ||
| - name: console-image | ||
| type: string | ||
| description: "console image from snapshot" | ||
| - name: commit | ||
| type: string | ||
| description: "commit sha to be used in console tests" | ||
| script: | | ||
| dnf -y install jq | ||
| echo -n "$(jq -r --arg component_name "lightspeed-agentic-console" '.components[] | select(.name == $component_name) | .containerImage' <<< "$SNAPSHOT")" > $(step.results.console-image.path) | ||
| echo -n "$(jq -r --arg component_name "lightspeed-agentic-console" '.components[] | select(.name == $component_name) | .source.git.revision' <<< "$SNAPSHOT")" > $(step.results.commit.path) | ||
| - name: lint | ||
| description: Run static checks | ||
| runAfter: | ||
| - extract-snapshot-metadata | ||
| params: | ||
| - name: commit | ||
| value: $(tasks.extract-snapshot-metadata.results.commit) | ||
| taskSpec: | ||
| params: | ||
| - name: commit | ||
| steps: | ||
| - name: run-lint | ||
| env: | ||
| - name: COMMIT_SHA | ||
| value: $(params.commit) | ||
| image: mcr.microsoft.com/playwright:v1.60.0-noble | ||
| resources: | ||
| limits: | ||
| memory: 4Gi | ||
| script: | | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
| cd /home | ||
| git clone https://github.com/openshift/lightspeed-agentic-console.git | ||
| cd lightspeed-agentic-console | ||
| git fetch origin "${COMMIT_SHA}" | ||
| git config advice.detachedHead false | ||
| git checkout "${COMMIT_SHA}" | ||
| echo "---------------------------------------------" | ||
| echo "node version: $(node -v)" | ||
| echo "npm version: $(npm -v)" | ||
| echo "---------------------------------------------" | ||
| NODE_OPTIONS=--max-old-space-size=4096 npm ci --omit=optional --no-fund | ||
| echo "---------------------------------------------" | ||
| npm run lint | ||
| echo "---------------------------------------------" | ||
| npm run test | ||
| echo "---------------------------------------------" | ||
| npm run i18n | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.