-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add parent dependency check on samples #195
Add parent dependency check on samples #195
Conversation
Signed-off-by: Michael Valdron <[email protected]>
Signed-off-by: Michael Valdron <[email protected]>
Signed-off-by: Michael Valdron <[email protected]>
Signed-off-by: Michael Valdron <[email protected]>
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: michael-valdron The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Michael Valdron <[email protected]>
Signed-off-by: Michael Valdron <[email protected]>
…_file.sh now builds the parents yaml file and returns the children samples of the parent stacks. Signed-off-by: Michael Valdron <[email protected]>
Signed-off-by: Michael Valdron <[email protected]>
Signed-off-by: Michael Valdron <[email protected]>
a69aa8c
to
88722d5
Compare
…es job. Signed-off-by: Michael Valdron <[email protected]>
Signed-off-by: Michael Valdron <[email protected]>
1a372a1
to
3464e43
Compare
Workflow tested on the |
Tied branch now called |
- One can test the child samples using the [validate_devfile_schemas]() test suite by performing the following: | ||
```sh | ||
export STACKS=$(bash tests/build_parents_file.sh) | ||
STACKS_DIR=samples/.cache bash tests/validate_devfile_schemas.sh |
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've tried to test the script locally following the instructions:
- Upon root dir of project I had this error:
$ STACKS_DIR=samples/.cache bash tests/validate_devfile_schemas.sh
+ stacksDir=samples/.cache
+ stackDirs='nodejs-basic code-with-quarkus go-basic java-springboot-basic python-basic'
+ ginkgo run --procs 2 tests/validate_devfile_schemas -- -stacksPath samples/.cache -stackDirs 'nodejs-basic code-with-quarkus go-basic java-springboot-basic python-basic'
Failed to compile validate_devfile_schemas:
go: cannot find main module, but found .git/config in <mypath>/michael_valdron/devfile-registry
to create a module there, run:
go mod init
Ginkgo ran 1 suite in 12.799434ms
Test Suite Failed
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.
@thepetk What is your output for go version
?
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.
Made changes 7c0d08c so STACKS_DIR
can be either a relative or absolute path when executing validate_devfile_schemas.sh
.
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.
@thepetk What is your output for
go version
?
@michael-valdron output is
go version go1.19.1 linux/amd64
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.
@thepetk What is your output for
go version
?@michael-valdron output is
go version go1.19.1 linux/amd64
@thepetk try running it again with a go 1.18.x runtime, go 1.19.1 could be having issues running it.
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.
Finally got it run successfully :)
One thing I had to do other than those steps, was to add a go.work
file in my repo's root dir.
It seems that is working fine :)
One test I tried to make is to update the go-basic sample inside the extraDevfileEntries. I've tried to include multiple sample versions:
- name: go-basic
displayName: Basic Go
description: Go 1.16 application
icon: https://go.dev/blog/go-brand/Go-Logo/SVG/Go-Logo_Blue.svg
tags:
- Go
projectType: Go
language: Go
provider: Red Hat
versions:
- version: 1.0.2
schemaVersion: 2.1.0
git:
remotes:
origin: https://github.com/devfile-samples/devfile-sample-go-basic.git
- version: 2.1.0
schemaVersion: 2.2.0
default: true
git:
checkoutFrom:
revision: update_devfile
remotes:
origin: https://github.com/thepetk/devfile-sample-go-basic.git
In the parent file I had:
- name: go
children:
- name: go-basic
version: 1.0.2
- name: go
version: 2.1.0
children:
- name: go-basic
version: 2.1.0
(Which is ok)
During testing I was expecting to see the test fail for one of the golang children (go-basic version 2.1.0). Although I had an issue with the quarkus
. The trace of the test was:
• [FAILED] [1.984 seconds]
validate stacks follow the schema [It] stack: code-with-quarkus
/home/tpetkos/github/michael_valdron/devfile-registry/tests/validate_devfile_schemas/validate_devfile_schemas_test.go:50
Timeline >>
{/home/tpetkos/github/michael_valdron/devfile-registry/samples/.cache/go-basic/2.1.0/devfile.yaml [] <nil> <nil> [] <nil> <nil> map[] <nil>}
[FAILED] in [It] - /home/tpetkos/github/michael_valdron/devfile-registry/tests/validate_devfile_schemas/validate_devfile_schemas_test.go:61 @ 08/01/23 17:18:55.812
<< Timeline
[FAILED] Expected
<*errors.withStack | 0xc0004dde60>: {
error: <*errors.withMessage | 0xc000693e40>{
cause: <*multierror.Error | 0xc000693e20>{
Errors: [
<*errors.errorString | 0xc000450cd0>{
s: "Some Commands are already defined in parent: build-image, deploy, deployk8s. If you want to override them, you should do it in the parent scope.",
},
],
ErrorFormat: nil,
},
msg: "failed to populateAndParseDevfile",
},
stack: [0x14db668, 0x14e2e38, 0x156ad58, 0x1530e1b, 0x1543958, 0x46d841],
}
to be nil
In [It] at: /home/tpetkos/github/michael_valdron/devfile-registry/tests/validate_devfile_schemas/validate_devfile_schemas_test.go:61 @ 08/01/23 17:18:55.812
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.
During testing I was expecting to see the test fail for one of the golang children (go-basic version 2.1.0).
Although I had an issue with the quarkus. The trace of the test was:• [FAILED] [1.984 seconds] validate stacks follow the schema [It] stack: code-with-quarkus /home/tpetkos/github/michael_valdron/devfile-registry/tests/validate_devfile_schemas/validate_devfile_schemas_test.go:50 Timeline >> {/home/tpetkos/github/michael_valdron/devfile-registry/samples/.cache/go-basic/2.1.0/devfile.yaml [] <nil> <nil> [] <nil> <nil> map[] <nil>} [FAILED] in [It] - /home/tpetkos/github/michael_valdron/devfile-registry/tests/validate_devfile_schemas/validate_devfile_schemas_test.go:61 @ 08/01/23 17:18:55.812 << Timeline [FAILED] Expected <*errors.withStack | 0xc0004dde60>: { error: <*errors.withMessage | 0xc000693e40>{ cause: <*multierror.Error | 0xc000693e20>{ Errors: [ <*errors.errorString | 0xc000450cd0>{ s: "Some Commands are already defined in parent: build-image, deploy, deployk8s. If you want to override them, you should do it in the parent scope.", }, ], ErrorFormat: nil, }, msg: "failed to populateAndParseDevfile", }, stack: [0x14db668, 0x14e2e38, 0x156ad58, 0x1530e1b, 0x1543958, 0x46d841], } to be nil In [It] at: /home/tpetkos/github/michael_valdron/devfile-registry/tests/validate_devfile_schemas/validate_devfile_schemas_test.go:61 @ 08/01/23 17:18:55.812
This is an interesting result, it is reporting the stack as being code-with-quarkus
but the error in the test seems to be the expected one with go-basic 2.1.0
, I'll need to check if there is a problem with the inputs or if there is a bug within this test suite which is causing the wrong stack name to be reported.
Signed-off-by: Michael Valdron <[email protected]>
Signed-off-by: Michael Valdron <[email protected]>
85b03b6
to
1b375fb
Compare
Signed-off-by: Michael Valdron <[email protected]>
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@michael-valdron: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Closing due to age, will re-open when focus to devfile/api#1142 is resumed. |
Resuming review of changes here: #397 |
What does this PR do?:
Summarize the changes. Are any stacks or samples added or updated?
Adds new script and new workflow to perform testing on child samples of stacks.
Which issue(s) this PR fixes:
Link to github issue(s)
fixes devfile/api#1142
PR acceptance criteria:
Have you read the devfile registry contributing guide and followed its instructions?
Does this repository's tests pass with your changes?
Does any documentation need to be updated with your changes?
Have you tested the changes with existing tools, i.e. Odo, Che, Console? (See devfile registry contributing guide on how to test changes)
How to test changes / Special notes to the reviewer: