Skip to content
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

Migrate Zeebe tests to certification tests #3112

Merged
merged 5 commits into from
Sep 8, 2023
Merged

Migrate Zeebe tests to certification tests #3112

merged 5 commits into from
Sep 8, 2023

Conversation

akkie
Copy link
Contributor

@akkie akkie commented Sep 4, 2023

Description

Converte Zeebe integration tests to Dapr certifications tests.

Fixes: #3111

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

@akkie akkie requested review from a team as code owners September 4, 2023 09:46
@ItalyPaleAle ItalyPaleAle added this to the v1.13 milestone Sep 5, 2023
@berndverst berndverst marked this pull request as draft September 5, 2023 22:03
@berndverst
Copy link
Member

Converted this to a draft PR. Since the title still says "Work in progress". Additionally, please address @ItalyPaleAle's concern.

metadata:
name: zeebe-command
spec:
type: bindings.zeebe.command
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file be used as a conformance test or can a conformance test be added as well? Ideally, for the components we will want both explicit certification and conformance tests. Following the doc here, conformance tests would entail a tests/config/bindings/zeebe/bindings.yml.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Components of type bindings contain a bit of everything, so conformance tests are often not much useful. If we have a good, comprehensive cert test, that's usually enough for a binding, especially for something that's more "unique" like Zeebe

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, so even though our certification lifecycle doc specified that for beta stage we have conformance tests and for alpha we have certification tests having it as is, and no explicit conformance tests, is sufficient for the beta stage?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That document is correct, but we need to consider the specifics of each situation. A conformance test exists to ensure that all components behave similarly and can be used "interchangeably". This is very useful for things like state stores, secret stores, etc.

However, this binding has about a dozen operations that are unique to this component, so there's not much to "conform to".

Eventually, the decision to make this beta or stable will be at the maintainers' discretion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for explaining. I'm looking into the issues related to moving the zeebe command binding & zeebe jobworker binding to stable is why I was asking.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cicoyle Please, add this binding to conformance test to keep us following the process. I understand that we had discussions about how much value conformance tests can actually add to bindings, but I would prefer to keep the process until we reach a formal decision. A change to the certification process should go into proposals IMO since it is big enough.

Copy link
Member

@berndverst berndverst Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@artursouza adding a conformance test doesn't add value here since there isn't any standardized behavior and interface being tested in bindings. It just means taking up more GitHub actions runners.

I think this PR here is good enough to make the component stable. Also, I am surprised to find this discussion buried in comments on a PR from another author. That is not where this discussion belongs.

@akkie akkie changed the title WIP: Migrate Zeebe tests to certification tests Migrate Zeebe tests to certification tests Sep 6, 2023
@akkie akkie marked this pull request as ready for review September 6, 2023 15:44
bindings/zeebe/command/command.go Show resolved Hide resolved
bindings/zeebe/command/create_instance.go Outdated Show resolved Hide resolved
bindings/zeebe/command/metadata.yaml Outdated Show resolved Hide resolved
bindings/zeebe/jobworker/jobworker.go Show resolved Hide resolved
bindings/zeebe/jobworker/metadata.yaml Outdated Show resolved Hide resolved
tests/certification/bindings/zeebe/certs/cert.pem Outdated Show resolved Hide resolved
@ItalyPaleAle
Copy link
Contributor

@akkie Thanks for this contribution, so far looks good :)

Could I ask one favor, please, to not force-push after we've done a review? When you force-push, GitHub features such as "changes since your last review" don't work anymore, so it makes it harder to review PRs (especially larger ones like this).

We always squash-merge anyways, so no issues with keeping a lot of commits in the history.

Signed-off-by: Christian Kaps <ck-github@mohiva.com>
@akkie akkie mentioned this pull request Sep 7, 2023
7 tasks
@akkie
Copy link
Contributor Author

akkie commented Sep 7, 2023

@akkie Thanks for this contribution, so far looks good :)

Could I ask one favor, please, to not force-push after we've done a review? When you force-push, GitHub features such as "changes since your last review" don't work anymore, so it makes it harder to review PRs (especially larger ones like this).

We always squash-merge anyways, so no issues with keeping a lot of commits in the history.

Sorry, I usually squash my commits to easier rebase my changes on top of the latest master. Will not do it anymore.

Signed-off-by: Bernd Verst <github@bernd.dev>
Signed-off-by: Bernd Verst <github@bernd.dev>
@berndverst
Copy link
Member

FYI @akkie I pushed two commits - one to enable the certification tests in CI (this is critical), and one to fix a linter issue!

@berndverst berndverst enabled auto-merge September 8, 2023 00:06
@berndverst berndverst dismissed ItalyPaleAle’s stale review September 8, 2023 00:09

Review feedback was addressed. Further changes can be made in follow up PR.

Copy link
Member

@berndverst berndverst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akkie

There is a bug in unit tests now:

--- FAIL: TestInit (0.00s)
    --- FAIL: TestInit/jobType_is_mandatory (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x94ea24]

goroutine 7 [running]:
testing.tRunner.func1.2({0x9d3340, 0xf1[76](https://github.com/dapr/components-contrib/actions/runs/6115916495/job/16600289608?pr=3112#step:9:77)00})
	/opt/hostedtoolcache/go/1.20.7/x64/src/testing/testing.go:1526 +0x24e
testing.tRunner.func1()
	/opt/hostedtoolcache/go/1.20.7/x64/src/testing/testing.go:1529 +0x39f
panic({0x9d3340, 0xf17600})
	/opt/hostedtoolcache/go/1.20.7/x64/src/runtime/panic.go:8[84](https://github.com/dapr/components-contrib/actions/runs/6115916495/job/16600289608?pr=3112#step:9:85) +0x213
github.com/dapr/components-contrib/bindings/zeebe/jobworker.(*ZeebeJobWorker).Close(0xb59ce0?)
	/home/runner/work/components-contrib/components-contrib/bindings/zeebe/jobworker/jobworker.go:144 +0xe4
github.com/dapr/components-contrib/bindings/zeebe/jobworker.TestInit.func1(0x0?)
	/home/runner/work/components-contrib/components-contrib/bindings/zeebe/jobworker/jobworker_test.go:61 +0x1a5
testing.tRunner(0xc0001f5520, 0xc000010[87](https://github.com/dapr/components-contrib/actions/runs/6115916495/job/16600289608?pr=3112#step:9:88)0)
	/opt/hostedtoolcache/go/1.20.7/x64/src/testing/testing.go:1576 +0x10b
created by testing.(*T).Run
	/opt/hostedtoolcache/go/1.20.7/x64/src/testing/testing.go:1629 +0x3ea
	```

@berndverst
Copy link
Member

Running the tests on Mac instead I got:

--- FAIL: TestOperations (0.00s)
    command_test.go:96:
        	Error Trace:	/Users/bverst/src/dapr/components-contrib/bindings/zeebe/command/command_test.go:96
        	Error:      	Not equal:
        	            	expected: 12
        	            	actual  : 13
        	Test:       	TestOperations
FAIL
FAIL	github.com/dapr/components-contrib/bindings/zeebe/command	0.794s
--- FAIL: TestInit (0.00s)
    --- FAIL: TestInit/jobType_is_mandatory (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1542cac]

@berndverst
Copy link
Member

Please note that the contrib code freeze was technically weeks ago and this PR does change an existing component - not just tests. We can only include this PR if you can fix it up before we will be cutting the 1.12 release branch - which may be end of day tomorrow or on Monday.

Signed-off-by: Christian Kaps <ck-github@mohiva.com>
auto-merge was automatically disabled September 8, 2023 07:02

Head branch was pushed to by a user without write access

@akkie
Copy link
Contributor Author

akkie commented Sep 8, 2023

@berndverst Fixed the issue

Signed-off-by: Christian Kaps <ck-github@mohiva.com>
@akkie
Copy link
Contributor Author

akkie commented Sep 8, 2023

Can someone please approve the workflows again. There was a test failing

@berndverst berndverst merged commit ba36895 into dapr:master Sep 8, 2023
@ItalyPaleAle ItalyPaleAle added the documentation required This issue needs documentation label Sep 8, 2023
@akkie akkie deleted the migrate-zeebe-tests branch September 11, 2023 05:03
@berndverst berndverst modified the milestones: v1.13, v1.12 Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation required This issue needs documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert Zeebe integration tests to Dapr certification tests
5 participants