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

关于向secretpad中集成自定义Component组件前测试的问题 #1263

Closed
Lucas-16 opened this issue Apr 23, 2024 · 2 comments
Closed

Comments

@Lucas-16
Copy link

Issue Type

Others

Source

binary

Secretflow Version

1.5

OS Platform and Distribution

CentOS7.9

Python version

3.10.3

Bazel version

No response

GCC/Compiler version

No response

What happend and What you expected to happen.

自定义了组件(Component)后想集成到secretpad中,但是在集成之前不知道如何测试自己开发的组件是否可以顺利执行?在github上看到https://github.com/secretflow/secretflow/blob/main/secretflow/component/test_framework/README.md这个目录下有个疑似测试的教程。但是发现里面测试的组件TestComp好像只是一个class类,而不是像Component那样的定义方式。想请问下有没较完善的在将Component集成到secretpad前测试的教程?感觉如果无法在集成前对组件进行测试的话,开发难度会很大。

Reproduction code to reproduce the issue.

官方文档中Component组件的定义方式(感觉和test_framework中的开发方式不一致):
ss_compare_comp = Component(
    "ss_compare",
    domain="user",
    version="0.0.1",
    desc="""compare two tables.""",
)
https://github.com/secretflow/secretflow/blob/main/secretflow/component/test_framework/README.md中TestComp的定义方式:
@dataclass
class TestComp:
    uid: str
    comp_domain: str
    comp_name: str
    comp_version: str
    attrs: Dict[str, object]
@Chrisdehe
Copy link
Member

@Lucas-16 hey
我们建议你可以先写组件的单测,比如:https://github.com/secretflow/secretflow/tree/main/tests/component

我们使用pytest来测试代码,测试相关事项请查看:https://github.com/secretflow/secretflow/blob/main/CONTRIBUTING.md#test

感谢!

Copy link

Stale issue message. Please comment to remove stale tag. Otherwise this issue will be closed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants