Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/infra/e2e_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def cli_args(
"-b",
"--binary-dir",
help="Path to CCF binaries (cchost, scurl, keygenerator)",
default=".",
default="../build",
)
Comment on lines 66 to 70
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

Changing the default --binary-dir to ../build makes the CLI default dependent on the caller's current working directory being tests/ (or similar). This is likely to break existing workflows that invoke these scripts from the build directory (where -b . used to work without specifying it) or from an installed tree. Consider deriving the default from the script location and/or probing common candidate directories (e.g. prefer . if it contains keygenerator.sh, else fall back), rather than hard-coding a relative path.

Copilot uses AI. Check for mistakes.
parser.add_argument(
"--library-dir",
Expand Down
2 changes: 1 addition & 1 deletion tests/infra/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def __init__(

for host in self.hosts:
self.create_node(
host, version=self.version, node_data_json_file=node_data_json_file
host, binary_dir=binary_dir, version=self.version, node_data_json_file=node_data_json_file
)

def _get_next_local_node_id(self):
Expand Down
7 changes: 5 additions & 2 deletions tests/infra/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def __init__(
self.BIN = infra.path.build_bin_path(self.BIN, binary_dir=binary_dir)
# 7.x releases combined binaries and removed the separate cchost entry-point
if major_version is None or major_version >= 7:
Comment on lines 377 to 378
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

The decision to override self.BIN based solely on major_version >= 7 conflicts with the later version-based CLI logic which still adds --enclave-file for versions <= 7.0.0-dev1. For tags like ccf-7.0.0-dev0/dev1 (see CHANGELOG), this would make the node try to execute enclave_file as the host binary even though these versions still require the cchost entry-point plus --enclave-file. Consider selecting the entry-point based on the parsed full version (the same threshold used for the --enclave-file flag) rather than major_version alone, so 7.0.0-dev0/dev1 keep using cchost.

Suggested change
# 7.x releases combined binaries and removed the separate cchost entry-point
if major_version is None or major_version >= 7:
# 7.x releases combined binaries and removed the separate cchost entry-point.
# Use the same full-version threshold as the CLI logic which drops --enclave-file:
# only versions strictly greater than 7.0.0-dev1 use the combined binary as entry-point.
if "version" in locals() and version is not None:
if version > Version("7.0.0-dev1"):
self.BIN = infra.path.build_bin_path(
enclave_file, binary_dir=binary_dir
)
elif major_version is None or major_version >= 7:
# Fallback for callers which only provide major_version

Copilot uses AI. Check for mistakes.
self.BIN = enclave_file
self.BIN = infra.path.build_bin_path(enclave_file, binary_dir=binary_dir)

self.common_dir = common_dir
self.pub_host = host.get_primary_interface().public_host
Expand Down Expand Up @@ -554,7 +554,10 @@ def __init__(

json.dump(j, f, indent=2)

exe_files += [self.BIN, enclave_file] + self.DEPS
exe_files += [self.BIN]
if major_version is not None and major_version < 7:
exe_files += [enclave_file]
exe_files += self.DEPS
data_files += [self.ledger_dir] if self.ledger_dir else []
data_files += [self.snapshots_dir] if self.snapshots_dir else []
data_files += (
Expand Down
48 changes: 48 additions & 0 deletions tests/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "ccf-tests"
version = "0.0.0"
requires-python = ">=3.12"

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.envs.default]
skip-install = true
dependencies = [
"ccf @ {root:uri}/../python/",
"wheel >= 0.46.2, < 0.47",
"loguru >= 0.7.3, < 0.8",
"openapi-spec-validator >= 0.7.2, < 0.8",
"PyJWT >= 2.10.0, < 3",
"docutils >= 0.22.2, < 0.23",
"python-iptables >= 1.2.0, < 1.3",
"py-spy >= 0.4.1, < 0.5",
"GitPython >= 3.1.45, < 4",
"better_exceptions >= 0.3.3, < 0.4",
"pyasn1 >= 0.6.1, < 0.7",
"Jinja2 >= 3.1.6, < 4",
# Later versions of httpx cause failures in long forwarding,
# extended character range and JWT tests.
"httpx[http2] == 0.23.*",
"locust >= 2.41.6, < 3",
"JWCrypto >= 1.5.6, < 2",
"rich >= 14.2.0, < 15",
"gelidum >= 0.9.1, < 1",
"matplotlib >= 3.10.7, < 4",
# Piccolo dependencies
"fastparquet >= 2024.11.0, < 2025",
"prettytable >= 3.16.0, < 4",
"polars >= 1.34.0, < 2",
"plotext >= 5.3.2, < 6",
"boofuzz >= 0.4.2, < 0.5",
"numpy >= 1.26.4, < 2",
"cwt >= 3.2.0, < 4",
"aiohttp >= 3.13.0, < 4",
]

[tool.hatch.envs.default.scripts]
commit-latency = "python commit_latency.py {args}"
Loading