How to upload proto files used by GRPC test to the cloud

How can I upload proto files for GRPC testing to the cloud? There is 14 proto files in total in directory/subdirectory structure, so it’s not a single directory structure. I guess base64 encoding of all proto files (~100KB) into test script and creating directory/file structure before test is quite overkill.

Hi @jangaraj, welcome to the forum :tada:

Just running k6 cloud script.js should automatically upload the required files. Does this not work for you?

k6 cloud script.js - it creates archive, uploads it to the k6 cloud and runs the test in the k6 cloud. But I can’t edit script via web UI ( - also I can’t view uploaded proto files via web UI. It looks like web UI is prepared only for single file tests.

I guess I will have to use setup test life cycle for downloading proto files structure from the web.

The web app editor isn’t really meant for development in it, at least for now, there have been some talks on making it more versatile but that is in practice making an IDE.

But you can just edit them locally and upload them with k6 cloud script.js every time there is a change, which also will likely be very easy to automate instead of doing in the web app. Also if you need to use them with the grpc api you can’t do that in setup.

Why I can’t do this:

export function setup() {
  // download proto files from the web and prepare proto directory structure

export default function (data) {
  // grpc testing with proto files created in the setup()

Client.load which is the call that will load the proto files needs to be called in the init context and doesn’t take files but file names that are then loaded from the filesystem. Which is also why it’s only in the init context, that is the only place you can read from the filesystem.

There is currently a PR to add grpc reflection(that won’t land in v0.34.0 in a week, but probably will in v0.35.0 in 2months), but nobody has asked for loading from loaded proto files in memory, so please open an issue with your usecase :).

Yeah, I got it. I would say it is not a critical issue. I will be using local k6 testing.

Unfortunately, my tested GRPC server (Open Telemtry Collector) doesn’t support GRPC reflection, so k6 GRPC reflection won’t fix this particular use case.

Anyawy, thank you for the help.