This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.11.6.5. Go 関数のテスト
Go 機能は、お使いのコンピューターのローカルでテストできます。kn func create
を使用した関数の作成時に作成される default プロジェクトには、一部の基本的なテストが含まれる handle_test.go
ファイルがあります。これらのテストは、必要に応じて拡張できます。
前提条件
- OpenShift Serverless Operator および Knative Serving がクラスターにインストールされている。
-
Knative (
kn
) CLI をインストールしている。 -
kn func create
を使用して関数を作成している。
手順
- 関数の test フォルダーに移動します。
テストを実行します。
go test
$ go test
Copy to Clipboard Copied! Toggle word wrap Toggle overflow