Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
martinothamar committed May 15, 2024
1 parent 2ff8d1a commit 7c6279d
Showing 1 changed file with 35 additions and 15 deletions.
50 changes: 35 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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._
Expand Down Expand Up @@ -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 - <k6/loadtest.js
```

For a decent editing experience, run `npm install` and use a editor with JS support.

### Known issues

#### Localtest reports that the app is not running even though it is
Expand Down

0 comments on commit 7c6279d

Please sign in to comment.