Problem/Motivation

In theory AI Agents tests can be run and re-run on the same Drupal site as they can undo any of the config they create. However this doesn't work perfectly and so sometimes tests will fail due to not having the same starting point. It would be great if we could run the tests but have them provisioned on an external system. Then bring the test results back into the website.

Therefore the AI Agents Test UI can act as a Host website that runs the tests on client sites that are destroyed when created.

General Question? To some degree I'm just creating the concept of functional tests from scratch. What below isn't necessary if we have a CI/CD system for functional tests?

Proposed resolution

  • - Have a button for "Run tests externally" where it will send some commands including drush commands to an external system for first creating the site and then running the tests. For now we will target Drupal forge.
  • - There will likely need to be a drush command for exporting and importing the tests as we should send the external site the tests as they are configured on the Host site.
  • - Maybe the host site should own the API keys and send API key information to the client site? Maybe API keys should be configured on the client platform to use those ones when it creates new sites? (I think I prefer that one).
  • - Host site needs to know what models are possible on the client site, or if they don't (We can handle this just through communication), we need error handling.
  • - We should be able to run more than one concurrently. (Have a UI for saying how many times you want to run the test).
  • - We need some way of bringing the test results back into the Drupal site. (So maybe have an export results that exports all the results details and then allow the drupal site to automatically pull in the results when they are completed. Or have some API where the external site can tell the original Drupal site the results and that its ready).
  • - In Detailed results we should mention where the tests were run. (Tests run locally, Test Run externally might be enough).
  • - We will need some way of configuring which platform handles the client sites. Is it gitlab CI/CD? Amazee?

What Drupal forge needs to do

The things we need:

  • An API that stores the API keys and providers
  • An API that allows us to programmatically take a Drupalforge template and built it. - and implement the API keys
  • API - To pass YAML files of newer tests (mayhbe taken from Gitlab) and import those test groups.
  • API - To run the actual tests, and receive results
  • API - to push the results back to somewhere (A drupal site? A command line response? Post the results as yaml to git? or a folder?)
  • Perhaps a Drupal module So a Drupal site can store Drupalforge credentials

Generally in the community / Drupalforge (Different issue)

  • A method of storing lots of test groups centrally somewhere where they can shared. (Could be a git repo)
  • A method of finding specific test groups through an API
  • A method of exporting a test group from a drupal site to this central store.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

yautja_cetanu created an issue. See original summary.

yautja_cetanu’s picture

Issue summary: View changes