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

Procedural api #7

Merged
merged 10 commits into from
Sep 14, 2023
Merged

Procedural api #7

merged 10 commits into from
Sep 14, 2023

Conversation

PietroPasotti
Copy link
Collaborator

@PietroPasotti PietroPasotti commented Sep 6, 2023

this PR implements the procedural API described in #3

Fixes #3

This is how an interface test will look:

def test_no_data_on_joined():
    # nothing happens on joined: databags are empty
    t = Tester()
    state = t.run('openfga-relation-joined')
    t.assert_relation_data_empty()

where one MUST:

  1. instantiate Tester within the scope of the test
  2. call t.run
  3. call one of
    a) t.assert_relation_data_empty, or
    b) t.assert_schema_valid or
    c) t.skip_schema_validation

in exactly this order. Otherwise the test will fail.

also, one CAN:

  • write assertions on state, to verify it matches the expectations

tandem PR: canonical/charm-relation-interfaces#101

Copy link
Collaborator

@gruyaume gruyaume left a comment

Choose a reason for hiding this comment

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

I mostly focused my review on user perspective and quality (and not so much on implementation) as I lack the requisite context for this project. Overall I think it looks good but we need better documentation.

interface_tester/cli/discover.py Show resolved Hide resolved
interface_tester/interface_test.py Outdated Show resolved Hide resolved
interface_tester/interface_test.py Outdated Show resolved Hide resolved
interface_tester/interface_test.py Outdated Show resolved Hide resolved
interface_tester/interface_test.py Show resolved Hide resolved
interface_tester/interface_test.py Show resolved Hide resolved
interface_tester/interface_test.py Show resolved Hide resolved
interface_tester/collector.py Outdated Show resolved Hide resolved
interface_tester/collector.py Outdated Show resolved Hide resolved
interface_tester/interface_test.py Outdated Show resolved Hide resolved
@PietroPasotti PietroPasotti merged commit f61ab60 into main Sep 14, 2023
2 checks passed
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.

implement procedural interface test specification language
3 participants