-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #395 from COS301-SE-2024/dev
Dev
- Loading branch information
Showing
109 changed files
with
55,721 additions
and
5,634 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Cypress Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- feature/integration-testing | ||
pull_request: | ||
branches: | ||
- dev | ||
- main | ||
|
||
jobs: | ||
cypress-run: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: '9.1.2' | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
cache-dependency-path: query-builder-app/pnpm-lock.yaml | ||
|
||
- name: Install redis | ||
run: sudo apt-get install -y redis-tools redis-server | ||
|
||
- name: Verify that redis is up | ||
run: redis-cli ping | ||
|
||
- name: start MySQL | ||
run: | | ||
sudo systemctl start mysql.service | ||
sudo mysql --user=${{ secrets.CYPRESS_DB_USERNAME }} --password=${{ secrets.CYPRESS_DB_PASSWORD }} < sakila/sakila-schema.sql; | ||
sudo mysql --user=${{ secrets.CYPRESS_DB_USERNAME }} --password=${{ secrets.CYPRESS_DB_PASSWORD }} < sakila/sakila-data.sql; | ||
sudo mysql -e 'SHOW DATABASES;' -h 127.0.0.1 --port=3306 --user=${{ secrets.CYPRESS_DB_USERNAME }} --password=${{ secrets.CYPRESS_DB_PASSWORD }} | ||
- name: Install Dependencies Backend | ||
run: | | ||
pnpm install --frozen-lockfile | ||
working-directory: query-builder-backend | ||
|
||
- name: Make backend env file | ||
run: | | ||
touch .env | ||
echo SUPABASE_URL = ${{ secrets.SUPABASE_URL }} >> .env | ||
echo SUPABASE_KEY = ${{ secrets.SUPABASE_ANON_KEY }} >> .env | ||
echo SUPABASE_JWT_SECRET = ${{ secrets.SUPABASE_JWT_SECRET }} >> .env | ||
echo UNI_KEY = ${{ secrets.UNI_KEY }} >> .env | ||
echo SESSION_SECRET = ${{ secrets.SESSION_SECRET }} >> .env | ||
echo REDIS_HOST = ${{ secrets.REDIS_HOST }} >> .env | ||
echo FRONTEND_URL = http://localhost:3000 >> .env | ||
echo OPENAI_API_KEY = ${{ secrets.OPENAI_API_KEY }} >> .env | ||
echo GEMINI_API_KEY = ${{ secrets.GEMINI_API_KEY }} >> .env | ||
cat .env | ||
working-directory: query-builder-backend | ||
|
||
- name: Build and start backend | ||
run: | | ||
pnpm run build && | ||
pnpm start & | ||
working-directory: query-builder-backend | ||
|
||
- name: Install Dependencies App | ||
run: | | ||
pnpm install --frozen-lockfile | ||
working-directory: query-builder-app | ||
|
||
- name: Make frontend env file | ||
run: | | ||
touch .env | ||
echo NEXT_PUBLIC_SUPABASE_URL = ${{ secrets.SUPABASE_URL }} >> .env | ||
echo NEXT_PUBLIC_SUPABASE_ANON_KEY = ${{ secrets.SUPABASE_ANON_KEY }} >> .env | ||
echo NEXT_PUBLIC_SUPABASE_PROJECT_ID = ${{ secrets.SUPABASE_SERVICE_ROLE_KEY}} >> .env | ||
echo NEXT_PUBLIC_BACKEND_URL = http://127.0.0.1:55555 >> .env | ||
cat .env | ||
working-directory: query-builder-app | ||
|
||
- name: Build and start frontend | ||
run: | | ||
pnpm run build && | ||
pnpm start & | ||
working-directory: query-builder-app | ||
|
||
- name: Cypress run | ||
uses: cypress-io/github-action@v6 | ||
env: | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | ||
CYPRESS_test_username: ${{ secrets.CYPRESS_TEST_USERNAME }} | ||
CYPRESS_test_password: ${{ secrets.CYPRESS_TEST_PASSWORD }} | ||
CYPRESS_mysql_username: ${{ secrets.CYPRESS_DB_USERNAME }} | ||
CYPRESS_mysql_password: ${{ secrets.CYPRESS_DB_PASSWORD }} | ||
with: | ||
record: true | ||
working-directory: query-builder-app | ||
wait-on: 'http://127.0.0.1:3000' | ||
spec: cypress/e2e/auth.cy.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
query-builder-backend/dump.rdb | ||
dump.rdb | ||
query-builder-app/cypress.env.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ yarn-error.log* | |
|
||
# local env files | ||
.env* | ||
cypress.env.json | ||
|
||
# vercel | ||
.vercel | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
143 changes: 0 additions & 143 deletions
143
query-builder-app/cypress/e2e/1-getting-started/todo.cy.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.