-
Notifications
You must be signed in to change notification settings - Fork 1.8k
e2e-tests: auto generate advanced molecule ansible tests with samples… #4312
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
e2e-tests: auto generate advanced molecule ansible tests with samples… #4312
Conversation
**Description of the change:** - update advanced mock static scenario with 1.0+ layout (#3433) - (note that we need to ensure that the test works with the new layout) - Fix CI issue (blocker master): `The error was: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='172.30.99.1', port=24443): Max retries exceeded with url: /version (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f28647cdb38>: Failed to establish a new connection: [Errno 110] Connection timed out',))` in GA. NOTE: The follow up here is to replace the test/ansible static mock with samples to ensure that we are testing it with the latest changes always. See the issue #4025 and its PR : #4312
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.
There is a typo. But in general what if this PR doesn't merge? While I understand what we're trying to do, I'm not 100% sure if this easier to maintain.
hack/tests/e2e-ansible-molecule.sh
Outdated
|
||
header_text "Test Ansible Molecule scenarios" | ||
pushd "${ROOTDIR}/test/ansible" | ||
header_text "Running Defualt test with advanced-molecule-operator/" |
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.
typo should read "Default"
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.
fixed
Hi @jmrodri. Just to clarifies. We are not replacing here a shell script by a go stack. Then, this PR solves this problem. After that, we are generating automatically the sample used for molecule tests. See that the e2e molecule runs 2 tests. One is based on a Memcached project with its specific scenarios which is automated by the go samples stack already. The other one runs using as mock the /test/ansible.
It makes it very easier since is :
PS.: We still able to just run the molecule generate go file and check the testdata created for development purpose as local tests as well. See the makefile call. (go run ./hack/generate/samples/molecule/generate.go) All your suggestions are addressed as well. Really tks. |
@camilamacedo86 okay. That makes a lot of sense. |
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.
/lgtm
@@ -20,6 +20,7 @@ website/tech-doc-hugo | |||
|
|||
# Ignore molecule samples testdata if it be generated in the testdata/ diretory | |||
testdata/ansible/memcached-molecule-operator | |||
testdata/ansible/advanced-molecule-operator |
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.
+1 good name
"github.com/operator-framework/operator-sdk/internal/testutils" | ||
) | ||
|
||
// MoleculeAnsible defines the context for the sample |
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.
// MoleculeAnsible defines the context for the sample | |
// AdcancedMolecule defines the context for the sample |
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.
Fixed
k8s_info: | ||
api_version: v1 | ||
kind: ConfigMap | ||
namespace: '{{ meta.namespace }}' |
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.
should this not be ansible_operator_meta
like the other one? https://github.com/operator-framework/operator-sdk/blob/master/testdata/ansible/memcached-operator/roles/memcached/tasks/main.yml#L9
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.
No. Because we pass in the watches file the var meta. see;
- version: v1alpha1 | |
group: test.example.com | |
kind: ReconciliationTest | |
playbook: playbooks/reconciliationtest.yml | |
vars: | |
meta: '{{ ansible_operator_meta }}' |
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.
hmm. IMO we ought to remove that and just access ansible_operator_meta directly. That said, it does not need to be in this PR, just something I noticed.
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.
/lgtm
**Description of the change:** - update advanced mock static scenario with 1.0+ layout (operator-framework#3433) - (note that we need to ensure that the test works with the new layout) - Fix CI issue (blocker master): `The error was: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='172.30.99.1', port=24443): Max retries exceeded with url: /version (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f28647cdb38>: Failed to establish a new connection: [Errno 110] Connection timed out',))` in GA. NOTE: The follow up here is to replace the test/ansible static mock with samples to ensure that we are testing it with the latest changes always. See the issue operator-framework#4025 and its PR : operator-framework#4312 Signed-off-by: reinvantveer <[email protected]>
operator-framework#4312) **Description** Replace static mock test/ansible by auto-generated mock via samples stack **Motivation for the change:** Ensure that e2e molecule tests are done with the PR changes by automating its generation. Otherwise, we cannot check if a change in the scaffold files could break it. Closes: operator-framework#4025 **Note**: To check the scenario locally run ` go run ./hack/generate/samples/molecule/generate.go` the advanced-molecule-operator will be generate in the testdata. Then, it can be checked for development purposes. Signed-off-by: reinvantveer <[email protected]>
**Description of the change:** - update advanced mock static scenario with 1.0+ layout (operator-framework#3433) - (note that we need to ensure that the test works with the new layout) - Fix CI issue (blocker master): `The error was: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='172.30.99.1', port=24443): Max retries exceeded with url: /version (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f28647cdb38>: Failed to establish a new connection: [Errno 110] Connection timed out',))` in GA. NOTE: The follow up here is to replace the test/ansible static mock with samples to ensure that we are testing it with the latest changes always. See the issue operator-framework#4025 and its PR : operator-framework#4312 Signed-off-by: rearl <[email protected]>
operator-framework#4312) **Description** Replace static mock test/ansible by auto-generated mock via samples stack **Motivation for the change:** Ensure that e2e molecule tests are done with the PR changes by automating its generation. Otherwise, we cannot check if a change in the scaffold files could break it. Closes: operator-framework#4025 **Note**: To check the scenario locally run ` go run ./hack/generate/samples/molecule/generate.go` the advanced-molecule-operator will be generate in the testdata. Then, it can be checked for development purposes. Signed-off-by: rearl <[email protected]>
Description
Replace static mock test/ansible by auto-generated mock via samples stack
Motivation for the change:
Ensure that e2e molecule tests are done with the PR changes by automating its generation. Otherwise, we cannot check if a change in the scaffold files could break it.
Closes: #4025
Note: To check the scenario locally run
go run ./hack/generate/samples/molecule/generate.go
the advanced-molecule-operator will be generate in the testdata. Then, it can be checked for development purposes.