e2e-tests: auto generate advanced molecule ansible tests with samples…#4312
e2e-tests: auto generate advanced molecule ansible tests with samples…#4312camilamacedo86 merged 3 commits intooperator-framework:masterfrom camilamacedo86:mocule-samples
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
jmrodri
left a comment
There was a problem hiding this comment.
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.
|
|
||
| header_text "Test Ansible Molecule scenarios" | ||
| pushd "${ROOTDIR}/test/ansible" | ||
| header_text "Running Defualt test with advanced-molecule-operator/" |
|
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. |
|
|
||
| # Ignore molecule samples testdata if it be generated in the testdata/ diretory | ||
| testdata/ansible/memcached-molecule-operator | ||
| testdata/ansible/advanced-molecule-operator |
| "github.com/operator-framework/operator-sdk/internal/testutils" | ||
| ) | ||
|
|
||
| // MoleculeAnsible defines the context for the sample |
There was a problem hiding this comment.
| // MoleculeAnsible defines the context for the sample | |
| // AdcancedMolecule defines the context for the sample |
| k8s_info: | ||
| api_version: v1 | ||
| kind: ConfigMap | ||
| namespace: '{{ meta.namespace }}' |
There was a problem hiding this comment.
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.
No. Because we pass in the watches file the var meta. see;
There was a problem hiding this comment.
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.
**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 <rein.van.t.veer@geodan.nl>
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 <rein.van.t.veer@geodan.nl>
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.gothe advanced-molecule-operator will be generate in the testdata. Then, it can be checked for development purposes.