Skip to content

Commit

Permalink
docs: use tabs to show platform specific options
Browse files Browse the repository at this point in the history
  • Loading branch information
eoaksnes committed Nov 3, 2022
1 parent 6ab6ea7 commit 2216c0a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 17 deletions.
31 changes: 18 additions & 13 deletions documentation/docs/contribute/development-guide/01-setup.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Setup

```mdx-code-block
import TabItem from '@theme/TabItem';
import Tabs from '@theme/Tabs';
```

## Prerequisites

To work with the template monorepo you'll need to install [these tools](../../about/running/01-prerequisites.md).
Expand Down Expand Up @@ -42,31 +47,31 @@ From inside the /api folder.

### Create virtualenv

Virtual environment is used for running unit tests with pre-commit and upgrade packages. It also can be used to run the application if you not are using Docker.

```shell
python3 -m venv .venv
```

Virtual environment is used for running unit tests with pre-commit and upgrade packages. It also can be used to run the application if you not are using Docker.

### Activate virtualenv

<details>
<summary>Linux</summary>
<Tabs groupId="operating-system">
<TabItem value="linux" label="Linux">

```shell
$ source .venv/bin/activate
```bash
source .venv/bin/activate
```
</details>

<details>
<summary>Windows</summary>
</TabItem>
<TabItem value="windows" label="Windows">

```shell
$ .\venv\Scripts\Activate.ps1
$ pip install --upgrade pip
```powershell
.\venv\Scripts\Activate.ps1
pip install --upgrade pip
```

</details>
</TabItem>
</Tabs>

### Install Poetry

Expand Down
25 changes: 21 additions & 4 deletions documentation/docs/contribute/development-guide/03-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,36 @@

## API

```mdx-code-block
import TabItem from '@theme/TabItem';
import Tabs from '@theme/Tabs';
```

The application has two types of API tests: unit tests and integration tests.

### Unit tests

You will find unit tests under `src/tests/unit`.

Using docker:
<Tabs groupId="api-testing">
<TabItem value="using-docker" label="Using docker">

```shell
docker-compose run --rm api pytest
```

Without using docker:
</TabItem>
<TabItem value="without-using-docker" label="Without using docker">

```shell
cd api/
pytest
```

</TabItem>
</Tabs>


As a general rule, unit tests should not have any external dependencies - especially on the file system.

### Integration tests
Expand All @@ -34,15 +46,20 @@ These tests depends on mongodb and that it's running.

### Unit tests

Without using docker:
<Tabs groupId="web-testing">
<TabItem value="using-docker" label="Using docker">

```shell
docker-compose run --rm web yarn test
```

Not using docker:
</TabItem>
<TabItem value="without-using-docker" label="Without using docker">

```shell
cd web/
yarn test
```

</TabItem>
</Tabs>

0 comments on commit 2216c0a

Please sign in to comment.