dfcx-scrapi icon indicating copy to clipboard operation
dfcx-scrapi copied to clipboard

[FR] CLI Driven Testing via App / Tool module

Open kmaphoenix opened this issue 2 years ago • 3 comments

Is your proposal related to a problem?

Some users are not able to run Colab notebooks due to enterprise security concerns with web-based runtimes. Additionally, using Python scripts via cron (i.e. Cloud Scheduler or similar) may also be off limits due to security.

In these cases, many organizations only allow CLI based commands (i.e. gcloud commands and similar) to be run ad-hoc via terminal sessions.

Describe the solution you'd like

We've developed an internal CLI based tool that utilizes SCRAPI under the hood, but is able to run directly on the command line to perform many of the basic functions that SCRAPI uses, including but not limited to:

  • CRUD functions for Resources
  • End to End Conversation Testing
  • NLU Regression Testing

Describe alternatives you've considered

One alternative that exists is a Go-based CLI Tool developed by another Google CE. While the Go library is completely functional and works great, we've had requests to consolidate tools like this into a single library like SCRAPI.

Since SCRAPI is broadly used across the organization and community, we will start to build this CLI tool into SCRAPI to provide a "one stop shop" for many of these types of resources.

kmaphoenix avatar Jul 14 '22 02:07 kmaphoenix

@kmaphoenix I was about to file a similar feature request and found this one. I'm going to append my wording:

I would like to invest a little time into the easy onboarding of new developers to this package... specifically inner dev loop workflow like:

  1. git clone
  2. make python-setup ## exists
  3. make authenticate ## new
  4. make test ## exists but doesn't work for me

You don't have to use make, but you should use some kind of configuration harness and put instructions into the repo.

I used the README.md and tried to get things working... I did the gcloud auth login and even gcloud config set project but I don't know how to wire in the proper details to run unit tests or integration tests and without that I don't really know how to get started contributing to the repo (without bothering you).

@ghchinoy FYI reference to https://github.com/ghchinoy/cxctl which is 404

zeroasterisk avatar Dec 21 '23 21:12 zeroasterisk

@zeroasterisk it seems like your request is slightly different than the original post I added here.

The original post was specifically concerning a CLI based alternative to a python install, but still using the SCRAPI library as the underpinning.

Your request seems more in line with "How do we eliminate toil when using SCRAPI in X environment?"
And more specifically, around authenticating, which has historically been a pain point for GCP development in general.

Re: Auth... The README covers this in as much detail as possible across several different environments.
I'd be curious to hear exact feedback about what isn't working for you and what environment you're working in.

Re: Unit / Integration Tests... Right now there are none.
Well, technically, there are a handful for 1 class, but they're not particularly meaningful.
It's a gap that I've been meaning to close on the library for some time, but haven't started it.

Re: Contributions... I would first start with familiarizing yourself with the basics.
Understand the components in core and how they're combined to make tools.
Then look for gaps that you'd like to fill in, or perhaps other tools you'd like to implement.
Or if you want to add things like apps that are more OOTB using SCRAPI, we can go there too.

I think the Bot Building Series 101 is the best place to start really, because it's core to what the library was originally meant to do...build and manage traditional Dialogflow CX bots using a simple API.

kmaphoenix avatar Dec 28 '23 01:12 kmaphoenix

Considering that this a tangent, I forked to https://github.com/GoogleCloudPlatform/dfcx-scrapi/issues/162 and this thread can remain focused on a CLI toolkit which might eventually come to pass. Thanks.

zeroasterisk avatar Dec 28 '23 19:12 zeroasterisk