Skip to content

Commit

Permalink
squash! Disable sign in/up
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulrhmnGhanem committed Jul 2, 2023
1 parent fca1920 commit 764e2c8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 41 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
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,32 +339,22 @@ docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-co

> Note: The GITEA_ADMIN_TOKEN is needed because the Gitea service is hidden and inaccessible to other containers.
> Before running e2e tests locally make sure to source the `.env` file: ` set -o allexport && source .env && set +o allexport`

### Without docker

Make sure that npm packages are installed

```console
yarn --cwd e2e
```
then you can run the tests with
Before running e2e tests locally make sure to:
1. source the `.env` file: ` set -o allexport && source .env && set +o allexport`
2. have all services running: `docker-compose up` and the frontend is being served at [http://kitspace.test:3000](http://kitspace.test:3000).
3. install npm packages: `yarn --cwd e2e`

### Without docker
```console
yarn --cwd e2e e2e --env GITEA_ADMIN_TOKEN=$(scripts/pre_e2e.sh)
GITEA_ADMIN_TOKEN="$(deno run --allow-env --allow-net --allow-run ./scripts/importBoardsTxt.ts --tokenOnly)"
yarn --cwd e2e e2e --env GITEA_ADMIN_TOKEN="$GITEA_ADMIN_TOKEN"
```

### GUI
Make sure that npm packages are installed

```console
yarn --cwd e2e
```
then you can open the GUI with

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


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 764e2c8

Please sign in to comment.