-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test/integration: don't check for deprecated Networks field #3362
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
test/integration: don't check for deprecated Networks field #3362
Conversation
|
Ah, fun; probably test-certs / fixtures expired? Or something else? |
ff8ebfc to
13887ba
Compare
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.
SGTM (but requesting a Copilot review just in case it's able to spot something)
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.
Pull Request Overview
This PR updates integration tests to check for the Networks field in the correct location after the deprecation of Spec.Networks in the Docker API. The tests are updated to check Spec.TaskTemplate.Networks instead of Spec.Networks, and network configurations are moved from service creation parameters to the TaskTemplate object.
Key changes:
- Network configurations moved from
create_service()parameters toTaskTemplateconstructor - Assertions updated to check
svc_info['Spec']['TaskTemplate']['Networks']instead ofsvc_info['Spec']['Networks']
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| assert new_index > version_index | ||
|
|
||
| task_tmpl = docker.types.TaskTemplate( | ||
| container_spec, networks=[net1['Id']] |
Copilot
AI
Oct 17, 2025
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.
Extra space before 'networks' parameter. Should be single space after comma.
| container_spec, networks=[net1['Id']] | |
| container_spec, networks=[net1['Id']] |
These tests depended on the deprecated Spec.Networks field, which
is no longer part of current API versions, causing the test to
fail;
=================================== FAILURES ===================================
_____________ ServiceTest.test_create_service_with_custom_networks _____________
tests/integration/api_service_test.py:379: in test_create_service_with_custom_networks
assert 'Networks' in svc_info['Spec']
E AssertionError: assert 'Networks' in {'Labels': {}, 'Mode': {'Replicated': {'Replicas': 1}}, 'Name': 'dockerpytest_a538894175d07404', 'TaskTemplate': {'Con...pec': {'Command': ['true'], 'Image': 'alpine:3.10', 'Isolation': 'default'}, 'ForceUpdate': 0, 'Runtime': 'container'}}
____________ ServiceTest.test_update_service_with_defaults_networks ____________
tests/integration/api_service_test.py:1128: in test_update_service_with_defaults_networks
assert 'Networks' in svc_info['Spec']
E AssertionError: assert 'Networks' in {'Labels': {}, 'Mode': {'Replicated': {'Replicas': 1}}, 'Name': 'dockerpytest_6d8e30f359c0f5e', 'TaskTemplate': {'Cont...pec': {'Command': ['true'], 'Image': 'alpine:3.10', 'Isolation': 'default'}, 'ForceUpdate': 0, 'Runtime': 'container'}}
_____________ ServiceTest.test_update_service_with_network_change ______________
tests/integration/api_service_test.py:1333: in test_update_service_with_network_change
assert 'Networks' in svc_info['Spec']
E AssertionError: assert 'Networks' in {'Labels': {}, 'Mode': {'Replicated': {'Replicas': 1}}, 'Name': 'dockerpytest_d4e23667cdbaf159', 'TaskTemplate': {'Con... {'Command': ['echo', 'hello'], 'Image': 'busybox', 'Isolation': 'default'}, 'ForceUpdate': 0, 'Runtime': 'container'}}
------- generated xml file: /src/bundles/test-docker-py/junit-report.xml -------
=========================== short test summary info ============================
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
13887ba to
b520fb8
Compare
|
Looks like it did! Surprised CI didn't bart about it; usually it's picky in Python w.r.t. white-spaces and formatting. |
|
Not sure that's really an error in this case, just unneeded white space |
|
Yeah; I'm too used to Go just formatting my stuff! 😂 Either way; it's green; I'll bring this one in! |
These tests depended on the deprecated Spec.Networks field, which is no longer part of current API versions, causing the test to fail;