Skip to content

Commit

Permalink
Merge branch 'main' into BC-7905-update-documentation-on-tldraw
Browse files Browse the repository at this point in the history
  • Loading branch information
bergatco authored Dec 9, 2024
2 parents 7e69a3f + 172e1a9 commit d877d76
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 7 deletions.
23 changes: 16 additions & 7 deletions docs/e2e-system-tests/0_GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,24 @@ Make sure you have access to the repository using your organization's credential

---

## 3. Setting Up Environment Configuration
## 3. Setting Up Environment Variables for the Testing User Credentials and URLs

1. Duplicate the `template.env.json` file located in the `env_variables` directory:
1. Setting Up Environment Variables for Dev Environment/Cluster:

- Rename the duplicated file to `local.env.json`.
- Update `local.env.json` with your credentials and environment-specific variables from 1Password.
- Ensure that the credentials match the correct namespace vault (staging, dev, etc.) in 1Password.
- Duplicate the file [devTemplate.env.json](https://github.com/hpi-schul-cloud/e2e-system-tests/blob/main/env_variables/devTemplate.env.json) and rename the duplicated file to `local.env.json` inside the `env_variables` folder.
- Include the required development namespace URLs for BRB/DBC/NBC.
- Test user data on development clusters are created using the school API.
- To retrieve the API keys for all three namespaces, navigate to 1Password (1PW).
- Contact QA team for the necessary 1Password links.

2. This configuration is required for accessing APIs, authentication, and other environment-specific services.
2. Setting Up Environment Variables for Staging Environment/Cluster:

- Duplicate the file [stagingTemplate.env.json](https://github.com/hpi-schul-cloud/e2e-system-tests/blob/main/env_variables/stagingTemplate.env.json) and rename the duplicated file to `staging.env.json` in the `env_variables` folder.
- Include the required staging namespace URLs for BRB/DBC/NBC.
- Test data on the staging environment are fetched from the seed data on the server.
- Add the environment-specific credentials to `staging.env.json` from 1Password (1PW).
- Ensure all instances are included, as 1Password contains different vaults for each namespace with testing credentials.
- Contact QA team for the necessary 1Password links.

---

Expand Down Expand Up @@ -75,4 +84,4 @@ Once the setup is complete, you can run the tests:
npm run cy:gui:stable:regression:staging:local
```

For more details on additional configurations and test options, refer to the [`Running Tests Guide`](https://github.com/hpi-schul-cloud/e2e-system-tests/blob/main/docs/running_tests_guide.md) section in README.
For more details on additional configurations and test options, refer to the [`Executing Tests Guide`](https://github.com/hpi-schul-cloud/e2e-system-tests/blob/main/docs/executing_tests_guide.md) section in README.
9 changes: 9 additions & 0 deletions docs/syncronizations/TSP/Architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Architecture

## TspSyncStrategy

This strategy handles the sync of schools, students, teachers and classes from TSP and replaces both the legacy TspBaseSyncer and TspSchoolSyncer. It responds to the target "tsp".

The flow looks like this (some of the logic for syncing is done in the provisioning strategy which is shared with the login):

![Flow of the TSP sync strategy](tsp_sync_strategy.png)
52 changes: 52 additions & 0 deletions docs/syncronizations/TSP/How it works.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# How it works

## Configuration

- FEATURE_TSP_SYNC_ENABLED - Activates the sync strategy inside the sync console

- WITH_TSP_SYNC - Activates the cronjob in Kubernetes

- TSP_API_CLIENT_BASE_URL - Base URL for the TSP API

- TSP_API_TOKEN_LIFETIME_MS - Lifetime of the access token for the TSP API in milliseconds

- TSP_SYNC_SCHOOL_LIMIT - The amount of schools the sync handles at once

- TSP_SYNC_SCHOOL_DAYS_TO_FETCH - The amount of days for which the sync fetches schools from the TSP API

- TSP_SYNC_DATA_LIMIT - The amount of school data updates the sync handles at once

- TSP_SYNC_DATA_DAYS_TO_FETCH - The amount of days for which the sync fetches school data from the TSP API

- FEATURE_TSP_MIGRATION_ENABLED - Activates the migration of TSP users within the sync

- TSP_SYNC_MIGRATION_LIMIT - The amount of users the sync migrates at once

## Sync console

This is a console application that allows you to start the synchronization process for different sources.

### Usage

To start the synchronization process, run the following command:

```bash
npm run nest:start:console sync run <target>
```

Where `<target>` is the name of the system you want to start the synchronization for. The currently available systems are:

- `tsp` - Synchronize Thüringer Schulportal.

If the target is not provided, the synchronization will not start and the available targets will be displayed in an error message.

```bash
{
message: 'Either synchronization is not activated or the target entered is invalid',
data: { enteredTarget: 'tsp', availableTargets: { TSP: 'tsp' }}
}
```
### TSP synchronization
The TSP synchronization is controlled with the feature flag `FEATURE_TSP_SYNC_ENABLED`.
Binary file added docs/syncronizations/TSP/tsp_sync_strategy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d877d76

Please sign in to comment.