简体   繁体   English

我们可以在谷歌云上运行 a.feature(Gherkin) 文件吗?

[英]Can we run a .feature(Gherkin) file on google cloud?

I have been working on a code that uses Python Behave(cucumber, language gherkin).我一直在研究使用 Python Behave(黄瓜,语言小黄瓜)的代码。 I wanna put that code as a google cloud function.我想将该代码作为谷歌云 function。 My question is can we fire.feature files from the google cloud shell?我的问题是我们可以从谷歌云 shell 中获取 fire.feature 文件吗?

Unfortunately, the Gherkin language is not currently supported by Google Cloud Functions, as you can see here , because they are executed in language-specific runtimes:不幸的是,Google Cloud Functions 目前不支持 Gherkin 语言,正如您在此处看到的那样,因为它们是在特定于语言的运行时中执行的:

Cloud Functions can be written in Node.js, Python, Go, Java, .NET, Ruby, and PHP programming languages, and are executed in language-specific runtimes. Cloud Functions can be written in Node.js, Python, Go, Java, .NET, Ruby, and PHP programming languages, and are executed in language-specific runtimes.

Even though you can [add Python dependencies], the language must be Python;即使您可以[添加 Python 依赖项],语言必须是 Python; as you are trying to deploy Gherkin code, I would suggest trying to use the library instead of the CLI, in which case you can have more chances to succeed, as the language used is still Python.当您尝试部署 Gherkin 代码时,我建议您尝试使用而不是 CLI,在这种情况下,您可以获得更多成功的机会,因为使用的语言仍然是 Python。 That way, you don't have to use.feature files.这样,您就不必使用 .feature 文件。 You can see how to add the dependency in the link mentioned above.您可以在上面提到的链接中查看如何添加依赖项。

Using the library is the preferred way to use Gherkin, since it produces easily consumable AST and Pickle objects in-process without having to fork a CLI process or parse JSON.使用库是使用 Gherkin 的首选方式,因为它可以在进程内轻松生成可使用的 AST 和 Pickle 对象,而无需派生 CLI 进程或解析 JSON。

The library itself provides a stream API, which is what the CLI is based on.该库本身提供了一个 stream API,这是 CLI 所基于的。 This is the recommended way to use the library, as it provides a high level API that is easy to use.这是使用该库的推荐方式,因为它提供了易于使用的高级 API。

If in any case you find trouble using the library, you can still change to Google Cloud Run , as it has a similar approach of serverless architecture with the freedom of using any language, library or binary.如果在任何情况下您在使用该库时遇到问题,您仍然可以更改为Google Cloud Run ,因为它具有类似的无服务器架构方法,可以自由使用任何语言、库或二进制文件。

Any language, any library, any binary.任何语言、任何库、任何二进制文件。

Use the programming language of your choice, any language or operating system libraries, or even bring your own binaries.使用您选择的编程语言、任何语言或操作系统库,甚至自带二进制文件。

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

相关问题 如何使用 Python 将 Gherkin 功能文件转换或解析为 JSON object - How to convert or parse a Gherkin Feature FIle into JSON object using Python 谷歌云数据流可以在本地运行,但不能在云上运行 - google cloud dataflow can run locally but can't run on the cloud Google Cloud Run 不加载 .env 文件 - Google Cloud Run does not load .env file 如何在谷歌云function中运行exe文件? - How to run an exe file in google cloud function? Google云外壳能否运行Python3 - Can Google cloud shell run Python3 我们可以在不使用Cloud Composer的情况下运行气流模板吗 - can we run airflow templates without using cloud composer 我们如何在Google Cloud上部署django应用程序? - How can we deploy a django app onn google cloud? 我们可以使用 GCP Cloud function 将数据从 Google 云存储发送到 SFTP 服务器吗? - Can we send data from Google cloud storage to SFTP server using GCP Cloud function? 通过在云中运行的笔记本从谷歌驱动器访问电子表格文件 - Accessing spreadsheet file from google drive through notebook run in the cloud 来自 google cloud dataproc python notebook 的 Run.py 文件 - Run .py file from google cloud dataproc python notebook
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM