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

Add etcd release compatibility tests #14610

Closed
wants to merge 1 commit into from
Closed

Conversation

serathius
Copy link
Member

cc @ahrtr

@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2022

Codecov Report

Merging #14610 (9ceec77) into main (0dfd726) will decrease coverage by 0.04%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main   #14610      +/-   ##
==========================================
- Coverage   75.50%   75.45%   -0.05%     
==========================================
  Files         457      457              
  Lines       37299    37299              
==========================================
- Hits        28163    28145      -18     
- Misses       7369     7380      +11     
- Partials     1767     1774       +7     
Flag Coverage Δ
all 75.45% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/proxy/grpcproxy/register.go 69.76% <0.00%> (-11.63%) ⬇️
client/v3/experimental/recipes/queue.go 58.62% <0.00%> (-6.90%) ⬇️
client/v3/leasing/util.go 91.66% <0.00%> (-6.67%) ⬇️
client/pkg/v3/fileutil/purge.go 68.85% <0.00%> (-6.56%) ⬇️
server/storage/mvcc/kvstore_compaction.go 95.65% <0.00%> (-4.35%) ⬇️
server/etcdserver/api/v3rpc/watch.go 82.53% <0.00%> (-3.81%) ⬇️
server/etcdserver/txn/util.go 75.47% <0.00%> (-3.78%) ⬇️
server/etcdserver/api/v3rpc/util.go 70.96% <0.00%> (-3.23%) ⬇️
server/etcdserver/api/v3rpc/member.go 93.54% <0.00%> (-3.23%) ⬇️
server/storage/mvcc/kvstore.go 89.00% <0.00%> (-1.42%) ⬇️
... and 15 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ahrtr
Copy link
Member

ahrtr commented Oct 24, 2022

It seems you are doing multiple things in one PR. Please try to break down this PR, and each PR should only do one thing.

Such as renaming etcd-last-release to etcd-previous-release, let's get it fixed in a separate PR, so that we can get it merged as soon as possible.

tests/framework/config/cluster.go Show resolved Hide resolved
tests/common/e2e_test.go Show resolved Hide resolved
@@ -34,4 +42,10 @@ type ClusterConfig struct {
DisableStrictReconfigCheck bool
AuthToken string
SnapshotCount int

E2eConfig *E2eClusterConfig
Copy link
Member

Choose a reason for hiding this comment

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

It's weird to see e2e config in the common ClusterConfig, which shouldn't care about the test infra/env (e2e or integration) at all.

I would suggest to move all the code from common area to e2e packages.

Copy link
Member Author

Choose a reason for hiding this comment

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

This PR maintains invariant that tests in common do not care about cluster setup. However this should not be misunderstood that common framework itself doesn't care about e2e configuration. Goal of common framework is to abstract cluster setup so we can write a single test that works can be used as integration, e2e or upgrade.

Copy link
Member

Choose a reason for hiding this comment

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

I would suggest to move all the code from common area to e2e packages.

Have you considered this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if I understand what you mean by "all code". I think that putting E2eConfig into framework.Config config is a good decision as it makes it explicitly part of cluster configuration. I think it's more important that maintaining framework.Config generic.

If we want to create a cluster with different server binaries, it should be part of cluster config, even if we cannot setup such cluster during integration tests. That's why instrumentation tests will immidietly panic when they discover E2eConfig set.

As for other code added to package, I cannot move it to e2e because it would create an import cycle.

Copy link
Member

Choose a reason for hiding this comment

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

Points:

  1. Just as the comment Add etcd release compatibility tests #14610 (comment) I raised previously, let's try to do one thing in one PR. If you get the change on e2eClusterTestCases() in a separate PR, it might have already been approved and merged.
  2. "all code" means all code related to E2eConfig, which means it doesn't include the code related to e2eClusterTestCases() mentioned above.
  3. Regarding to it should be part of cluster config, why not to add whatever config specific to e2e test into EtcdProcessClusterConfig and test cases specific to e2e into e2e package? It's really weird to add E2eConfig into the common ClusterConfig.
  4. With regard to "However this should not be misunderstood that common framework itself doesn't care about e2e configuration", I don't agree this. The diagram I provided about 9 months ago is still valid. FYI. Unify testing framework #13637 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

Points:

  1. Just as the comment Add etcd release compatibility tests #14610 (comment) I raised previously, let's try to do one thing in one PR. If you get the change on e2eClusterTestCases() in a separate PR, it might have already been approved and merged.

It doesn't make sense to move e2eClusterTestCases as splitting integration and e2e scenarios is not nesesery if we change implementation of this PR.

  1. "all code" means all code related to E2eConfig, which means it doesn't include the code related to e2eClusterTestCases() mentioned above.

As mentioned above code for E2eConfig cannot be moved because of import cycles.

  1. Regarding to it should be part of cluster config, why not to add whatever config specific to e2e test into EtcdProcessClusterConfig and test cases specific to e2e into e2e package? It's really weird to add E2eConfig into the common ClusterConfig.

When thinking about unifying testing via common framework we need to separate test scenario from cluster setup (need to work on naming to avoid confusion). By test scenario I mean a test like "TestPutKV" it just takes a cluster, puts a key and verifies that it's there. Test scenario itself doesn't care how cluster was created.

This brings me to testing clusters with servers having different versions. This is not a test scenario, but a cluster setup. It doesn't make sense to have a specific test scenarios just because it requires some specific e2e configuration. We can reuse all existing common test scenarios and run them against the specific e2e cluster configuration.

You keep saying that ClusterConfig is common, but it's not part of common package not it was meant to be generic. For now it only has properties shared by both e2e and integration tests, but that just because we haven't migrated any test that would require a e2e specific cluster setup.

  1. With regard to "However this should not be misunderstood that common framework itself doesn't care about e2e configuration", I don't agree this. The diagram I provided about 9 months ago is still valid. FYI. Unify testing framework #13637 (comment)

Thank's for diagram, however it's not set in stone truth. Original proposal didn't set such limitations.

Copy link
Member

Choose a reason for hiding this comment

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

Don't you think ClusterConfig is a common struct, which is used by both e2e and integration test, and it's an anti-pattern for integration checks something it shouldn't care about at all?

Copy link
Member

Choose a reason for hiding this comment

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

Please see also #14683

Copy link
Member Author

@serathius serathius Nov 6, 2022

Choose a reason for hiding this comment

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

There are two parts we need to agree on:

  • Should hybrid version tests be part of common tests.
  • How to integrate E2e config into common tests. Let's discuss this after we agree on the first point.

First, hybrid version clusters are expected to behave exactly like a normal cluster. This means that we can and should run exactly the same tests as we do for other tests. Common tests are just a blackbox tests that replay scenarios that should work no matter if we use client library, etcdctl, single cluster node or multi cluster cluster node. They should also work in hybrid clusters (minus new features but however we also test protection against inconsistency during upgrade due to usage of new features).

Alternative that you proposed to have those tests as e2e does not scale. We would again be in a situation that we need to copy each and every test just change one line in configuration. Instead of thinking of hybrid clusters as a separate special test we should think it as a normal cluster that just has a different setup.

Does it make sense?

Copy link
Member

Choose a reason for hiding this comment

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

See #14697

@serathius
Copy link
Member Author

ping @ahrtr @spzala @ptabor

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants