Skip to content

Fix xml config with xml path#3189

Open
cbellot000 wants to merge 7 commits into
mainfrom
fix/xml_config
Open

Fix xml config with xml path#3189
cbellot000 wants to merge 7 commits into
mainfrom
fix/xml_config

Conversation

@cbellot000
Copy link
Copy Markdown
Contributor

@cbellot000 cbellot000 commented May 12, 2026

This PR fixes the server config: when an xml was provided, it was never given to the server

@cbellot000 cbellot000 requested a review from PProfizi May 12, 2026 13:21
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.88%. Comparing base (b20bdd4) to head (93a56ba).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3189      +/-   ##
==========================================
- Coverage   82.90%   82.88%   -0.02%     
==========================================
  Files          93       93              
  Lines       11603    11605       +2     
==========================================
  Hits         9619     9619              
- Misses       1984     1986       +2     

Comment thread tests/test_server.py Outdated
@PProfizi
Copy link
Copy Markdown
Contributor

Thanks for this @cbellot000 !

Co-authored-by: Paul Profizi <100710998+PProfizi@users.noreply.github.com>
Comment thread tests/test_server.py Outdated
Comment thread tests/test_server.py Outdated
Comment thread src/ansys/dpf/core/server_types.py Outdated
AvailableServerContexts.premium,
):
run_cmd.append(f"--context {int(context.licensing_context_type)}")
if context.licensing_context_type == 2 and len(context.xml_path) > 0:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is 2?
Could you provide an enum or a constant?

Comment thread src/ansys/dpf/core/server_types.py Outdated
Comment thread src/ansys/dpf/core/server_types.py Outdated
Comment on lines +149 to +152
if context.licensing_context_type == 2 and len(context.xml_path) > 0: # 2 == custom xml
run_cmd.append(f"--context {context.xml_path}")
else:
run_cmd.append(f"--context {int(context.licensing_context_type)}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What if licensing_context_type == 2 and len(context.xml_path) == 0?
It will specify --context 2, with no path to xml. Is it a problem?

Comment thread src/ansys/dpf/core/server_types.py Outdated
Comment thread tests/test_server.py
Comment on lines 173 to 186
@pytest.mark.skipif(
not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0, reason="not working properly before 25R2"
)
@pytest.mark.skipif(running_docker, reason="server start using custom xml not working on Docker")
def test_server_context_custom_xml(remote_config_server_type, testfiles_dir):
from pathlib import Path

context = dpf.core.AvailableServerContexts.no_context
context.xml_path = Path(testfiles_dir) / "DpfCustomDefinedTest.xml"
server_plugins = start_local_server(config=remote_config_server_type, context=context).plugins
ref = ["grpc", "native"]
assert sorted(list(server_plugins.keys())) == ref


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@cbellot000 this one is actually useless, right?

@cbellot000 cbellot000 enabled auto-merge (squash) May 13, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants