Setup Mockoon for testing

Created on 2 August 2024, about 2 months ago
Updated 9 September 2024, 12 days ago

Problem/Motivation

@mjb3141 has setup a first config for Mockoon. We need to be able to run that as part of the Gitlab config for the phpunit job.

Here is documentation on how to run something before the script:
https://project.pages.drupalcode.org/gitlab_templates/info/customizations/

Here is doucmentation on how to setup Mockoon together with a config:
https://blog-bertrand-thomas.devpro.fr/2022/03/09/mock-rest-api-calls-wi...

The Docker image is this, meaning it seems like we need to install npm:
https://git.drupalcode.org/project/drupalci_environments/-/blob/dev/webd...

We could look into if we should create our own Docker image later to shave some seconds from testing, but for now this will work.

Steps to reproduce

Proposed resolution

In the prescript write a script that in the phpunit job:
1. installs nodejs/npm
2. downloads and starts mockoon-cli with the json file from this repo https://gitlab.com/freelygive/openai-api-mock. This json file should be added to our repo, under tests.
3. Do a test call using curl to see that its working.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

AI Core module

Created by

🇩🇪Germany Marcus_Johansson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024