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

Test plugins with secrets #599

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

WIP

865c30f
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Open

Test plugins with secrets #599

WIP
865c30f
Select commit
Loading
Failed to load commit list.
GitHub Actions / Production Test Results failed Jan 24, 2024 in 0s

344 tests run, 342 passed, 1 skipped, 1 failed.

Annotations

Check failure on line 38 in tests/steamship_tests/plugin/integration/test_e2e_blockifier_with_secrets.py

See this annotation in the file changed.

@github-actions github-actions / Production Test Results

test_e2e_blockifier_with_secrets.test_e2e_blockifier_plugin

assert == failed. [pytest-clarity diff shown]
  #x1B[0m
  #x1B[0m#x1B[32mLHS#x1B[0m vs #x1B[31mRHS#x1B[0m shown below
  #x1B[0m
  #x1B[0m#x1B[31mFOO#x1B[0m
  #x1B[0m
Raw output
def test_e2e_blockifier_plugin():
        client = get_steamship_client()
        blockifier_path = PLUGINS_PATH / "blockifiers" / "blockifier_with_secrets.py"
    
        # Send up the configTemplate that would be derived from this class:
        #
        #     class DummyBlockifierConfig(Config):
        #         secret: str = Field("")
        #
        version_config_template = {
            "secret": {"type": "string", "default": ""},
        }
    
        # Deploy with the secrets TOML {secret: "FOO"}
        with deploy_plugin(
            client,
            blockifier_path,
            "blockifier",
            version_config_template=version_config_template,
            secrets_toml='secret="FOO"',
        ) as (
            plugin,
            version,
            instance,
        ):
            file = File.create(client=client, content="This is a test.")
            assert len(file.refresh().blocks) == 0
            file.blockify(plugin_instance=instance.handle).wait()
            file.refresh()
            assert len(file.blocks) == 1
>           assert file.blocks[0].text == "FOO"
E           assert == failed. [pytest-clarity diff shown]
E             #x1B[0m
E             #x1B[0m#x1B[32mLHS#x1B[0m vs #x1B[31mRHS#x1B[0m shown below
E             #x1B[0m
E             #x1B[0m#x1B[31mFOO#x1B[0m
E             #x1B[0m

tests/steamship_tests/plugin/integration/test_e2e_blockifier_with_secrets.py:38: AssertionError