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 test for succint role test case #141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AdamKorcz
Copy link
Contributor

@AdamKorcz AdamKorcz commented Aug 13, 2024

@AdamKorcz AdamKorcz force-pushed the succint-graph-traversal branch from a683fa4 to 80a96ea Compare August 13, 2024 21:03
Copy link
Member

@jku jku left a comment

Choose a reason for hiding this comment

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

Looks about right, left some minor comments.

However, I realized only now that the succinct delegations have not made it to the spec yet. I do want this in the test suite but we likely can't have it on by default, that would be annoying to clients who don't implement it.

Sorry to leave another PR hanging but we'll have to figure out how deal with optional features: maybe we add action inputs for them...

Comment on lines +120 to +122
client.download_target(init_data, succinct_bins_graph.target_path)
# Here we could check that target_info is null. TODO: Add when
# support for storing the target_info is added.
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 check the return value.

I am against support for storing targetinfo

# Check that metadata dir contains only top-level roles
assert client._files_exist(TOP_LEVEL_ROLE_NAMES)

# Looking for a non-existing targetpath forces updater
Copy link
Member

Choose a reason for hiding this comment

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

nit: "updater" is a python-tuf component

Comment on lines +124 to +127
# Check that the delegated roles were visited in the expected
# order and the corresponding metadata files were persisted.
assert repo.metadata_statistics[2:] == exp_calls
assert client._files_exist(exp_files)
Copy link
Member

Choose a reason for hiding this comment

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

_files_exist() does not verify that only these files exist so I think it adds little value here. I would remove it or wait for #138 where I add a ClientRunner method for that



@dataclass
class TestTarget:
Copy link
Member

Choose a reason for hiding this comment

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

does this name not make pytest warn?

Copy link
Member

Choose a reason for hiding this comment

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

PytestCollectionWarning: cannot collect test class 'TestTarget' because it has a __init__ constructor (from: tuf_conformance/test_updater_delegation_graphs.py)

@jku jku linked an issue Aug 14, 2024 that may be closed by this pull request
Copy link
Member

@jku jku left a comment

Choose a reason for hiding this comment

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

I'll mark this "changes requested":

  • We need a solution for "optional features" before we add this
  • optional features must be togglable in the action and in the command line
  • default is likely "don't enable"

Since this is not part of the core spec, it's also not that important to work on

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.

Test succinct delegations
2 participants