简体   繁体   English

如何从 Foundry 中的代码存储库编写或创建外部数据集

[英]How to write or create external dataset from code repository within Foundry

I am trying to achieve pytest functionality within the code repository.我正在尝试在代码存储库中实现 pytest 功能。 I want to a write or create a dataset so that the results of the test case can be put in to be viewed by business analysts.我想编写或创建一个数据集,以便业务分析师可以查看测试用例的结果。 this way I want to hide my code from business analysts.这样我想对业务分析师隐藏我的代码。 Business analysts or functional teams can put in data in the data file or fusion sheet and just view the results of the tests.业务分析师或职能团队可以将数据放入数据文件或融合表中,只需查看测试结果。 may I know ways to create a data set or write the data to the dataset(may be using APIs) which is outside of respository?我可以知道创建数据集或将数据写入存储库之外的数据集(可能正在使用 API)的方法吗?

I believe you may be confusing concepts, and the wording of your question doesn't really help.我相信你可能会混淆概念,你的问题的措辞并没有真正的帮助。 I feel there are two layers to this question, tests and writing datasets.我觉得这个问题有两层,测试和编写数据集。

So for formal unit tests, ie: with pylint, tests are run at CI time.所以对于正式的单元测试,即:使用 pylint,测试在 CI 时间运行。 The CI is isolated from foundry, which means it can't read datasets nor write to them. CI 与代工厂隔离,这意味着它无法读取数据集或写入数据集。 Code repositories, has built in logic to detect unit tests ran at CI time and display your tests one by one in the CI Checks view.代码存储库具有内置逻辑来检测在 CI 时运行的单元测试,并在 CI 检查视图中一一显示您的测试。

Reading and Writing to datasets is something owned by the transforms, so if you want to write the results of your tests into a dataset, my suggestion would be to wrap your tests into a transform, and then append the results as new rows.读取和写入数据集是转换所拥有的,因此如果您想将测试结果写入数据集,我的建议是将测试包装到转换中,然后将结果附加为新行。

This way you can both use a dataset as input as well as output the results to a separate dataset.通过这种方式,您既可以使用数据集作为输入,也可以将结果输出到单独的数据集。 Of course the way tests are written would change a bit, since technically they wouldn't be using pylint anymore, and would just be a transform.当然,编写测试的方式会有所改变,因为从技术上讲,它们将不再使用 pylint,而只是一种转换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM