-
Notifications
You must be signed in to change notification settings - Fork 395
[Devfile#1718 ] Adding renovate.json and test script to ensure sample can still be parsed and used by consumers #70
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
base: main
Are you sure you want to change the base?
Conversation
I did make this PR, I am not sure variables such as ${{ env.MINIKUBE_VERSION }} or ${{ env.KUBERNETES_VERSION }} is declared |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JslYoon Instead of trying to duplicate, I would suggest creating a new workflow that first pulls the devfile/registry repository, then runs the sample against each test suite. Also, good to create new check_*.sh
scripts as the sample itself is the only input, the ones from devfile/registry look for multiple stacks under a stacks/
directory.
57a089f
to
fedeb9a
Compare
51eb318
to
a8982d2
Compare
3629a8a
to
0f2b1a2
Compare
|
||
- name: Run Registry Validation Tests | ||
env: | ||
REGISTRY_PATH: ${{ github.workspace }}/registry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REGISTRY_PATH: ${{ github.workspace }}/registry |
No need to set for the step, it is already set for the entire job.
set -x | ||
|
||
# Path to the devfile in this sample repository | ||
SAMPLE_PATH="$(pwd)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SAMPLE_PATH="$(pwd)"
will not be overridden by a set environment variable, this will allow you to override SAMPLE_PATH
if its set as an environment variable or variable export:
SAMPLE_PATH="$(pwd)" | |
SAMPLE_PATH=${SAMPLE_PATH:-''} | |
if [ -z "${SAMPLE_PATH}" ]; then | |
SAMPLE_PATH="$(pwd)" | |
fi | |
|
||
set -x | ||
|
||
SAMPLE_PATH="$(pwd)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SAMPLE_PATH="$(pwd)" | |
SAMPLE_PATH=${SAMPLE_PATH:-''} | |
if [ -z "${SAMPLE_PATH}" ]; then | |
SAMPLE_PATH="$(pwd)" | |
fi | |
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use the latest target Go version current in devfile/registry:
go-version: '1.21' | |
go-version: '1.23' |
run: | | ||
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 | ||
sudo chmod +x /usr/local/bin/yq | ||
go install github.com/onsi/ginkgo/v2/ginkgo@latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use the current ginkgo
version in devfile/registry to avoid breakages:
go install github.com/onsi/ginkgo/v2/ginkgo@latest | |
go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JslYoon I wonder if it is worth having a separate repository for the sample test scripts then pull them into each sample workflow when they run 🤔
Would reduce the number of places we would need to maintain these under.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we could modify the ones under devfile/registry to take single stack/sample inputs then there is no need to have separate copies of these scripts for overriding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdyt?
- name: Setup test environment with overrides | ||
run: | | ||
# Copy entire project for devfile validation | ||
mkdir -p test-sample | ||
cp -r current-repo/* test-sample/ | ||
|
||
# Stage registry test files and apply local overrides | ||
mkdir -p test-environment/tests | ||
cp -r registry/tests/* test-environment/tests/ | ||
|
||
if [ -d "current-repo/tests" ]; then | ||
echo "Applying local test overrides..." | ||
cp -r current-repo/tests/* test-environment/tests/ 2>/dev/null || true | ||
fi | ||
|
||
# Copy staged files to execution location | ||
cp -r test-environment/tests/* registry/tests/ | ||
cp -r test-sample/* registry/tests/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could just use current-repo
path directly rather than coping into a new sample directory.
[Devfile#1718 ] Adding renovate.json and test script to ensure sample can still be parsed and used by consumers
devfile/api#1718
Adding renovate.json and test script to ensure sample can still be parsed and used by consumers.
tests include:
odov3
non-terminating
validate-devfile-schemas