From 7c6279d9a8a4c06de34328a5e540491389375baf Mon Sep 17 00:00:00 2001 From: Martin Othamar Date: Wed, 15 May 2024 08:51:54 +0200 Subject: [PATCH] Update README --- README.md | 50 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index f0cf591b..56b838f6 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,19 @@ These are some of the required steps, tips, and tricks when it comes to running an app on a local machine. The primary goal is to be able to iterate over changes and verifying them without needing to deploy the app to the test environment. -- [Local testing of apps](#local-testing-of-apps) - - [Prerequisites](#prerequisites) - - [Setup](#setup) - - [Clone the repository](#clone-the-repository) - - [Option A: Start the containers using podman](#option-a-start-the-containers-using-podman) - - [Option B: Start the containers using Docker](#option-b-start-the-containers-using-docker) - - [Option C (preview): Automatic detection](#option-c-preview-automatic-detection) - - [Start your app](#start-your-app) - - [Changing configuration](#changing-configuration) - - [Multiple apps at the same time (running LocalTest locally)](#multiple-apps-at-the-same-time-running-localtest-locally) - - [Changing test data](#changing-test-data) - - [Add a missing role for a test user](#add-a-missing-role-for-a-test-user) - - [Known issues](#known-issues) - - [Localtest reports that the app is not running even though it is](#localtest-reports-that-the-app-is-not-running-even-though-it-is) +- [Prerequisites](#prerequisites) +- [Setup](#setup) + - [Clone the repository](#clone-the-repository) + - [Option A: Start the containers using podman](#option-a-start-the-containers-using-podman) + - [Option B: Start the containers using Docker](#option-b-start-the-containers-using-docker) + - [Option C (preview): Automatic detection](#option-c-preview-automatic-detection) + - [Start your app](#start-your-app) +- [Changing configuration](#changing-configuration) +- [Multiple apps at the same time (running LocalTest locally)](#multiple-apps-at-the-same-time-running-localtest-locally) +- [Changing test data](#changing-test-data) + - [Add a missing role for a test user](#add-a-missing-role-for-a-test-user) +- [Known issues](#known-issues) + - [Localtest reports that the app is not running even though it is](#localtest-reports-that-the-app-is-not-running-even-though-it-is) ### Prerequisites @@ -122,7 +121,12 @@ Either docker or podman must be installed. ./run.cmd ``` -If the localtest setup is already running, it will restart +If the localtest setup is already running, it will restart. + +To stop localtest +```shell +./run.cmd stop +``` #### Start your app _This step requires that you have already [created an app](https://docs.altinn.studio/app/getting-started/create-app/), added a [data model](https://docs.altinn.studio/app/development/data/data-model/data-models-tool/), and [cloned the app](https://docs.altinn.studio/app/getting-started/local-dev/) to your local environment._ @@ -247,6 +251,22 @@ This would be required if your app requires a role which none of the test users 4. Save and close the file 5. Restart LocalTest +### k6 testing + +In the k6 folder there is a sample loadtest that can be adapted to run automated tests against a local app +It was created to simulate workloads and test monitoring and instrumentation. + +```shell +cp k6/loadtest.sample.js k6/loadtest.js + +# To run, either +make k6 +# or +docker run --rm -i --net=host grafana/k6:master-with-browser run -