Skip to content

Commit

Permalink
squash! Disable sign in/up
Browse files Browse the repository at this point in the history
Update README.md

Co-authored-by: Kaspar Emanuel <kaspar.emanuel@gmail.com>
  • Loading branch information
AbdulrhmnGhanem and kasbah committed Jul 3, 2023
1 parent decb287 commit 0872bab
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 43 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,14 @@ jobs:
GITEA_DEPLOY_IMAGE_TAG: ':${{ needs.get_version.outputs.gitea_sha }}'
shell: bash
run: |
token=$(scripts/pre_e2e.sh)
scripts/generate_e2e_fixtures.sh
# start gitea so we can generate the admin token required for e2e
docker-compose -f docker-compose.yml -f docker-compose.deploy.yml up -d
until docker logs kitspace_gitea_1 | grep -q 'ORM engine initialization successful' ; do sleep 3s; done
token="$(deno run --allow-env --allow-net --allow-run ./scripts/importBoardsTxt.ts --tokenOnly)"
docker-compose stop
echo "CYPRESS_GITEA_ADMIN_TOKEN=${token}" >> $GITHUB_ENV
- name: e2e
Expand Down
35 changes: 14 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,40 +328,33 @@ We configure our staging servers using [Ansible](https://docs.ansible.com/ansibl

## Running Integration Tests

1. Make sure the frontend is being served at [http://kitspace.test:3000](http://kitspace.test:3000); by following the "Set Up" steps. You can use one of the following options.
Make sure that:
1. the frontend is being served at [http://kitspace.test:3000](http://kitspace.test:3000); by following the "Set Up" steps. You can use one of the following options.
3. test fixtures are generated: `scripts/generate_e2e_fixtures.sh`
2. npm packages are installed: `yarn --cwd e2e` (when running the tests outside of docker).

### Run the tests in a docker container

> Note: The GITEA_ADMIN_TOKEN is needed when because the Gitea service is hidden and inaccessible to other containers.
### 1. Run the tests in a docker container
```console
export CYPRESS_GITEA_ADMIN_TOKEN="$(deno run --allow-env --allow-net --allow-run ./scripts/importBoardsTxt.ts --tokenOnly)"
docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.e2e.yml up e2e
```
##

> 🚧 **GITEA_ADMIN_TOKEN is needed because we have hid gitea and it's inaccessible to other containers!**
### Without docker

Make sure that npm packages are installed

```console
yarn --cwd e2e
```
then you can run the tests with

```console
yarn --cwd e2e e2e --env GITEA_ADMIN_TOKEN=$(scripts/pre_e2e.sh)
```

### GUI
Make sure that npm packages are installed

### 2. Without docker
```console
yarn --cwd e2e
export CYPRESS_GITEA_ADMIN_TOKEN="$(deno run --allow-env --allow-net --allow-run ./scripts/importBoardsTxt.ts --tokenOnly)"
yarn --cwd e2e e2e
```
then you can open the GUI with

### 3. GUI
```console
yarn --cwd e2e gui --env GITEA_ADMIN_TOKEN=$(scripts/pre_e2e.sh)
export CYPRESS_GITEA_ADMIN_TOKEN="$(deno run --allow-env --allow-net --allow-run ./scripts/importBoardsTxt.ts --tokenOnly)"
yarn --cwd e2e gui
```


Expand Down
8 changes: 8 additions & 0 deletions scripts/generate_e2e_fixtures.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -Eeuo pipefail

# Generate big files which are used during testing
# `uploadProject.spec.js` -> should reject files bigger than `MAX_FILE_SIZE`
auto_gen_fixtures_path=e2e/cypress/fixtures/auto-gen
rm -rf $auto_gen_fixtures_path && mkdir $auto_gen_fixtures_path
truncate -s "${MAX_FILE_SIZE}" "${auto_gen_fixtures_path}/big.txt"
21 changes: 0 additions & 21 deletions scripts/pre_e2e.sh

This file was deleted.

0 comments on commit 0872bab

Please sign in to comment.