From ad520e8ecb97be359cdad8d2a122f4daafa958ff Mon Sep 17 00:00:00 2001 From: junjiequan Date: Tue, 22 Oct 2024 12:49:02 +0200 Subject: [PATCH 1/9] refactor: remove unused and outdated files --- .github/workflows/build-release.yml | 55 ------------------ .github/workflows/deploy.yml | 20 +------ .github/workflows/test.yml | 14 +++-- CI/ESS/e2e/.env | 14 ----- CI/ESS/e2e/Dockerfile.e2e | 22 ------- .../.env.backend.e2e} | 2 +- CI/e2e/.env.scichat-loopback.e2e | 0 .../cypress.github.ts => e2e/cypress.e2e.ts} | 4 +- CI/{ESS => }/e2e/docker-compose.e2e.yaml | 45 +++++++------- .../frontend.config.e2e.json} | 0 .../functionalAccounts.e2e.json} | 0 CI/{ => to_be_deleted}/ESS/Dockerfile | 0 CI/{ => to_be_deleted}/ESS/Dockerfile.dmsc | 0 CI/{ => to_be_deleted}/ESS/config.dev.json | 0 CI/{ => to_be_deleted}/ESS/config.ldpc.json | 0 .../ESS/docker-compose.yaml | 0 CI/{ => to_be_deleted}/ESS/esslogo-white.png | Bin CI/{ => to_be_deleted}/ESS/favicon.ico | Bin .../ESS/scicat-logo-white.png | Bin CI/{ => to_be_deleted}/ESS/scicat-logo.png | Bin CI/{ => to_be_deleted}/ESS/site-logo.png | Bin CI/{ => to_be_deleted}/ESS/site.png | Bin CI/{ => to_be_deleted}/ESS/styles.scss | 0 CI/{ => to_be_deleted}/MAXIV/Dockerfile | 0 .../MAXIV/docker-compose.yaml | 0 .../MAXIV/google-fonts/css/fonts.css | 0 .../MAXIV/google-fonts/css/material-icons.css | 0 .../google-fonts/fonts/matrial-icon.woff2 | Bin .../fonts/titillium-web-v10-latin-200.woff2 | Bin .../fonts/titillium-web-v10-latin-300.woff2 | Bin .../titillium-web-v10-latin-400-normal.woff2 | Bin .../fonts/titillium-web-v10-latin-400.woff2 | Bin .../titillium-web-v10-latin-600-normal.woff2 | Bin .../titillium-web-v10-latin-700-normal.woff2 | Bin .../titillium-web-v10-latin-900-normal.woff2 | Bin .../titillium-web-v10-latin-ext-200.woff2 | Bin .../titillium-web-v10-latin-ext-300.woff2 | Bin ...tillium-web-v10-latin-ext-400-italic.woff2 | Bin .../titillium-web-v10-latin-ext-400.woff2 | Bin ...tillium-web-v10-latin-ext-600-normal.woff2 | Bin ...tillium-web-v10-latin-ext-700-normal.woff2 | Bin ...tillium-web-v10-latin-ext-900-normal.woff2 | Bin CI/{ => to_be_deleted}/MAXIV/index.html | 0 .../MAXIV/maxiv-favicon.ico | Bin CI/{ => to_be_deleted}/MAXIV/maxiv-logo.png | Bin CI/{ => to_be_deleted}/MAXIV/maxiv-site.png | Bin CI/{ => to_be_deleted}/MAXIV/maxiv-theme.scss | 0 .../MAXIV/scicat-logo-white.png | Bin CI/{ => to_be_deleted}/MAXIV/scicat-logo.png | Bin CI/{ => to_be_deleted}/MAXIV/theme.json | 0 CI/{ => to_be_deleted}/MLZ/Dockerfile | 0 CI/{ => to_be_deleted}/MLZ/Dockerfile.test | 0 CI/{ => to_be_deleted}/MLZ/Dockerfile_dev | 0 CI/{ => to_be_deleted}/MLZ/Jenkinsfile | 0 .../MLZ/config.development.json | 0 CI/{ => to_be_deleted}/MLZ/config.prod.json | 0 CI/{ => to_be_deleted}/MLZ/config.qa.json | 0 CI/{ => to_be_deleted}/MLZ/copyimages.sh | 0 CI/{ => to_be_deleted}/MLZ/site-logo.png | Bin CI/{ => to_be_deleted}/MLZ/site.png | Bin CI/{ => to_be_deleted}/PSI/Dockerfile | 0 CI/{ => to_be_deleted}/PSI/Dockerfile.test | 0 CI/{ => to_be_deleted}/PSI/Dockerfile_dev | 0 CI/{ => to_be_deleted}/PSI/Jenkinsfile | 0 .../PSI/config.development.json | 0 CI/{ => to_be_deleted}/PSI/config.prod.json | 0 CI/{ => to_be_deleted}/PSI/config.qa.json | 0 CI/{ => to_be_deleted}/PSI/copyimages.sh | 0 CI/{ => to_be_deleted}/PSI/site-logo.png | Bin CI/{ => to_be_deleted}/PSI/site.png | Bin CI/{ => to_be_deleted}/RFI/Dockerfile | 0 CI/{ => to_be_deleted}/RFI/Dockerfile.dev | 0 CI/{ => to_be_deleted}/RFI/config.dev.json | 0 CI/{ => to_be_deleted}/RFI/config.prod.json | 0 .../RFI/config.staging.json | 0 CI/{ => to_be_deleted}/RFI/datasources.json | 0 .../RFI/docker-compose.yaml | 0 CI/{ => to_be_deleted}/RFI/favicon.ico | Bin CI/{ => to_be_deleted}/RFI/karma.conf.js | 0 .../RFI/karma.specreport.js | 0 CI/{ => to_be_deleted}/RFI/providers.json | 0 .../RFI/scicat-logo-white.png | Bin CI/{ => to_be_deleted}/RFI/scicat-logo.png | Bin CI/{ => to_be_deleted}/RFI/site-logo.png | Bin CI/{ => to_be_deleted}/RFI/site.png | Bin CI/{ => to_be_deleted}/RFI/theme.scss | 0 .../e2e => to_be_deleted}/cypress.config.ts | 0 .../e2e => to_be_deleted}/cypress.nestjs.ts | 0 cypress.config.ts | 2 +- package-lock.json | 10 ++++ package.json | 1 + src/app/app.module.ts | 2 + 92 files changed, 47 insertions(+), 144 deletions(-) delete mode 100644 .github/workflows/build-release.yml delete mode 100644 CI/ESS/e2e/.env delete mode 100644 CI/ESS/e2e/Dockerfile.e2e rename CI/{ESS/e2e/.env.backend-next => e2e/.env.backend.e2e} (92%) create mode 100644 CI/e2e/.env.scichat-loopback.e2e rename CI/{ESS/e2e/cypress.github.ts => e2e/cypress.e2e.ts} (86%) rename CI/{ESS => }/e2e/docker-compose.e2e.yaml (67%) rename CI/{ESS/e2e/config.e2e.json => e2e/frontend.config.e2e.json} (100%) rename CI/{ESS/e2e/functionalAccounts.json => e2e/functionalAccounts.e2e.json} (100%) rename CI/{ => to_be_deleted}/ESS/Dockerfile (100%) rename CI/{ => to_be_deleted}/ESS/Dockerfile.dmsc (100%) rename CI/{ => to_be_deleted}/ESS/config.dev.json (100%) rename CI/{ => to_be_deleted}/ESS/config.ldpc.json (100%) rename CI/{ => to_be_deleted}/ESS/docker-compose.yaml (100%) rename CI/{ => to_be_deleted}/ESS/esslogo-white.png (100%) rename CI/{ => to_be_deleted}/ESS/favicon.ico (100%) rename CI/{ => to_be_deleted}/ESS/scicat-logo-white.png (100%) rename CI/{ => to_be_deleted}/ESS/scicat-logo.png (100%) rename CI/{ => to_be_deleted}/ESS/site-logo.png (100%) rename CI/{ => to_be_deleted}/ESS/site.png (100%) rename CI/{ => to_be_deleted}/ESS/styles.scss (100%) rename CI/{ => to_be_deleted}/MAXIV/Dockerfile (100%) rename CI/{ => to_be_deleted}/MAXIV/docker-compose.yaml (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/css/fonts.css (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/css/material-icons.css (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/matrial-icon.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-200.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-300.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-400-normal.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-400.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-600-normal.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-700-normal.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-900-normal.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-200.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-300.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-400-italic.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-400.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-600-normal.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-700-normal.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-900-normal.woff2 (100%) rename CI/{ => to_be_deleted}/MAXIV/index.html (100%) rename CI/{ => to_be_deleted}/MAXIV/maxiv-favicon.ico (100%) rename CI/{ => to_be_deleted}/MAXIV/maxiv-logo.png (100%) rename CI/{ => to_be_deleted}/MAXIV/maxiv-site.png (100%) rename CI/{ => to_be_deleted}/MAXIV/maxiv-theme.scss (100%) rename CI/{ => to_be_deleted}/MAXIV/scicat-logo-white.png (100%) rename CI/{ => to_be_deleted}/MAXIV/scicat-logo.png (100%) rename CI/{ => to_be_deleted}/MAXIV/theme.json (100%) rename CI/{ => to_be_deleted}/MLZ/Dockerfile (100%) rename CI/{ => to_be_deleted}/MLZ/Dockerfile.test (100%) rename CI/{ => to_be_deleted}/MLZ/Dockerfile_dev (100%) rename CI/{ => to_be_deleted}/MLZ/Jenkinsfile (100%) rename CI/{ => to_be_deleted}/MLZ/config.development.json (100%) rename CI/{ => to_be_deleted}/MLZ/config.prod.json (100%) rename CI/{ => to_be_deleted}/MLZ/config.qa.json (100%) rename CI/{ => to_be_deleted}/MLZ/copyimages.sh (100%) rename CI/{ => to_be_deleted}/MLZ/site-logo.png (100%) rename CI/{ => to_be_deleted}/MLZ/site.png (100%) rename CI/{ => to_be_deleted}/PSI/Dockerfile (100%) rename CI/{ => to_be_deleted}/PSI/Dockerfile.test (100%) rename CI/{ => to_be_deleted}/PSI/Dockerfile_dev (100%) rename CI/{ => to_be_deleted}/PSI/Jenkinsfile (100%) rename CI/{ => to_be_deleted}/PSI/config.development.json (100%) rename CI/{ => to_be_deleted}/PSI/config.prod.json (100%) rename CI/{ => to_be_deleted}/PSI/config.qa.json (100%) rename CI/{ => to_be_deleted}/PSI/copyimages.sh (100%) rename CI/{ => to_be_deleted}/PSI/site-logo.png (100%) rename CI/{ => to_be_deleted}/PSI/site.png (100%) rename CI/{ => to_be_deleted}/RFI/Dockerfile (100%) rename CI/{ => to_be_deleted}/RFI/Dockerfile.dev (100%) rename CI/{ => to_be_deleted}/RFI/config.dev.json (100%) rename CI/{ => to_be_deleted}/RFI/config.prod.json (100%) rename CI/{ => to_be_deleted}/RFI/config.staging.json (100%) rename CI/{ => to_be_deleted}/RFI/datasources.json (100%) rename CI/{ => to_be_deleted}/RFI/docker-compose.yaml (100%) rename CI/{ => to_be_deleted}/RFI/favicon.ico (100%) rename CI/{ => to_be_deleted}/RFI/karma.conf.js (100%) rename CI/{ => to_be_deleted}/RFI/karma.specreport.js (100%) rename CI/{ => to_be_deleted}/RFI/providers.json (100%) rename CI/{ => to_be_deleted}/RFI/scicat-logo-white.png (100%) rename CI/{ => to_be_deleted}/RFI/scicat-logo.png (100%) rename CI/{ => to_be_deleted}/RFI/site-logo.png (100%) rename CI/{ => to_be_deleted}/RFI/site.png (100%) rename CI/{ => to_be_deleted}/RFI/theme.scss (100%) rename CI/{ESS/e2e => to_be_deleted}/cypress.config.ts (100%) rename CI/{ESS/e2e => to_be_deleted}/cypress.nestjs.ts (100%) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml deleted file mode 100644 index 220006985..000000000 --- a/.github/workflows/build-release.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Build release - -on: - release: - tags: - - "v*" - types: - - created - -jobs: - build-release: - name: Build release - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Login to GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Create image tags - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ghcr.io/${{ github.repository }} - scicatproject/frontend - flavor: latest=false - tags: | - type=raw,value=stable - type=ref,event=tag - - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64,linux/arm64/v8 - push: true - tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f17ba3282..0b049c8a8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,7 +3,7 @@ name: Deploy on: push: branches: - - master + - master env: NODE_VERSION: 18.x @@ -50,21 +50,3 @@ jobs: push: true platforms: linux/amd64,linux/arm64/v8 tags: ${{ steps.meta.outputs.tags }} - - - name: Trigger ESS pipeline - uses: swapActions/trigger-swap-deployment@v1 - with: - repository: ${{ github.event.repository.name }} - environment: develop - gh-trigger-url: ${{ secrets.GITLAB_TRIGGER_URL }} - gh-token: ${{ secrets.GITLAB_TRIGGER_TOKEN }} - image-tag: ${{ github.sha }} - - - name: Trigger MAXIV pipeline - uses: appleboy/gitlab-ci-action@master - with: - token: ${{ secrets.MAXIV_TOKEN }} - project_id: 21902377 - ref: "develop" - host: "https://gitlab.com" - debug: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 026a53711..affeca844 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -106,6 +106,8 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} + # These settings optimize memory and file handling for Elasticsearch, + # preventing common issues related to system limits running on github workflow. - name: Configure sysctl limits run: | sudo swapoff -a @@ -115,20 +117,20 @@ jobs: - name: Run docker-compose run: | - cp CI/ESS/e2e/docker-compose.e2e.yaml docker-compose.yaml + cp CI/e2e/docker-compose.e2e.yaml docker-compose.yaml docker compose pull docker compose build --no-cache docker compose up -d - - name: Wait for Backend - run: | - npm install -g wait-on - wait-on http://localhost:3000/api/v3/health --timeout 200000 + # - name: Wait for Backend + # run: | + # npm install -g wait-on + # wait-on http://localhost:3000/api/v3/health --timeout 200000 - name: Run Cypress tests uses: cypress-io/github-action@v6 with: - config-file: CI/ESS/e2e/cypress.github.ts + config-file: CI/ESS/e2e/cypress.e2e.ts install-command: npm install --omit peer browser: chrome diff --git a/CI/ESS/e2e/.env b/CI/ESS/e2e/.env deleted file mode 100644 index be510e01e..000000000 --- a/CI/ESS/e2e/.env +++ /dev/null @@ -1,14 +0,0 @@ -JWT_SECRET = "myjwts3cr3t" -JWT_EXPIRES_IN = "21600" -MONGODB_HOST="mongodb" -MONGODB_PORT=27017 -MONGODB_DB_NAME="scichat" -MONGODB_USER="" -MONGODB_PASSWORD="" -PORT=3030 -SCICHAT_USER="testUser" -SCICHAT_PASSWORD="password" -SYNAPSE_SERVER_NAME="ess" -SYNAPSE_SERVER_HOST="https://scitest.esss.lu.se" -SYNAPSE_BOT_NAME="" -SYNAPSE_BOT_PASSWORD="" diff --git a/CI/ESS/e2e/Dockerfile.e2e b/CI/ESS/e2e/Dockerfile.e2e deleted file mode 100644 index fbb697340..000000000 --- a/CI/ESS/e2e/Dockerfile.e2e +++ /dev/null @@ -1,22 +0,0 @@ -FROM node:18-alpine as builder -RUN sed -i -e 's/^root::/root:!:/' /etc/shadow -RUN apk update && apk upgrade && \ - apk add --no-cache bash git openssh wget - -WORKDIR /frontend -COPY package*.json /frontend/ -RUN npm ci -RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -COPY . /frontend/ -RUN npx ng build - -FROM nginx:1.21-alpine -RUN sed -i -e 's/^root::/root:!:/' /etc/shadow -RUN apk update && apk upgrade && \ - apk add --no-cache bash -RUN rm -rf /usr/share/nginx/html/* -COPY --from=builder /frontend/dist/ /usr/share/nginx/html -COPY --from=builder /frontend/wait-for-it.sh / -RUN chmod +x /wait-for-it.sh -COPY scripts/nginx.conf /etc/nginx/nginx.conf -EXPOSE 80 diff --git a/CI/ESS/e2e/.env.backend-next b/CI/e2e/.env.backend.e2e similarity index 92% rename from CI/ESS/e2e/.env.backend-next rename to CI/e2e/.env.backend.e2e index 1a1ffc0f8..b3b6283cc 100644 --- a/CI/ESS/e2e/.env.backend-next +++ b/CI/e2e/.env.backend.e2e @@ -13,7 +13,7 @@ LOGBOOK_BASE_URL="http://scichat-loopback:3000/scichatapi" METADATA_KEYS_RETURN_LIMIT=100 METADATA_PARENT_INSTANCES_RETURN_LIMIT=100 -MONGODB_URI="mongodb://mongodb:27017/scicat-backend-nestjs-e2e-testing" +MONGODB_URI="mongodb://mongodb:27017/test" PID_PREFIX="20.500.12269/" PUBLIC_URL_PREFIX="https://doi.ess.eu/detail/" PORT=3000 diff --git a/CI/e2e/.env.scichat-loopback.e2e b/CI/e2e/.env.scichat-loopback.e2e new file mode 100644 index 000000000..e69de29bb diff --git a/CI/ESS/e2e/cypress.github.ts b/CI/e2e/cypress.e2e.ts similarity index 86% rename from CI/ESS/e2e/cypress.github.ts rename to CI/e2e/cypress.e2e.ts index 0ca41895b..f757e94df 100644 --- a/CI/ESS/e2e/cypress.github.ts +++ b/CI/e2e/cypress.e2e.ts @@ -2,8 +2,8 @@ import { defineConfig } from "cypress"; export default defineConfig({ e2e: { - baseUrl: "http://localhost:8080", - lbBaseUrl: "http://localhost:8080/api/v3", + baseUrl: "http://localhost:4200", + lbBaseUrl: "http://localhost:3000/api/v3", lbLoginEndpoint: "/auth/login", lbTokenPrefix: "Bearer ", viewportWidth: 1280, diff --git a/CI/ESS/e2e/docker-compose.e2e.yaml b/CI/e2e/docker-compose.e2e.yaml similarity index 67% rename from CI/ESS/e2e/docker-compose.e2e.yaml rename to CI/e2e/docker-compose.e2e.yaml index 8f3bfda77..740b1b57a 100644 --- a/CI/ESS/e2e/docker-compose.e2e.yaml +++ b/CI/e2e/docker-compose.e2e.yaml @@ -1,14 +1,16 @@ version: "3.4" services: reverse-proxy: - image: traefik:2.5 + image: traefik:2.10 command: --api.insecure=true --providers.docker=true --entrypoints.web.address=:80 ports: - 8080:80 volumes: - /var/run/docker.sock:/var/run/docker.sock mongodb: - image: "bitnami/mongodb:latest" + ## As of 2024-10-22 bitnami mongoDB still do not support ARM64 + ## Change back to bitnami/mongodb when it supports ARM64 + image: "mongo:latest" ports: - "27017:27017" volumes: @@ -19,60 +21,55 @@ services: timeout: 10s retries: 5 start_period: 40s + scichat-loopback: - image: "ghcr.io/scicatproject/scichat-loopback:e2e" + image: "ghcr.io/scicatproject/scichat-loopback:latest" command: [ - "./wait-for-it.sh", - "mongodb:27017", - "--", "node", "-r", "dotenv/config", "." ] volumes: - - "./CI/ESS/e2e/.env:/home/node/app/.env" + - "./CI/e2e/.env.scichat-loopback.e2e:/home/node/app/.env" depends_on: mongodb: condition: service_healthy + backend: image: ghcr.io/scicatproject/backend-next:latest command: sh -c "node dist/main" ports: - 3000:3000 volumes: - - "./CI/ESS/e2e/.env.backend-next:/home/node/app/.env" - - "./CI/ESS/e2e/functionalAccounts.json:/home/node/app/functionalAccounts.json" - - "./CI/ESS/e2e/config.e2e.json:/home/node/app/dist/config/frontend.config.json" + - "./CI/e2e/.env.backend.e2e:/home/node/app/.env" + - "./CI/e2e/functionalAccounts.e2e.json:/home/node/app/functionalAccounts.json" + - "./CI/e2e/config.e2e.json:/home/node/app/dist/config/frontend.config.json" depends_on: mongodb: condition: service_healthy es01: condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:3000/api/v3/health"] + interval: 30s + timeout: 10s + retries: 5 labels: - "traefik.http.routers.backend.rule=PathPrefix(`/api/v3`, `/auth/msad`)" - "traefik.http.routers.backend.entrypoints=web" frontend: build: context: . - dockerfile: CI/ESS/e2e/Dockerfile.e2e - command: - [ - "./wait-for-it.sh", - "backend:3000", - "--", - "nginx", - "-g", - "daemon off;" - ] + dockerfile: Dockerfile ports: - 4200:80 volumes: - - "./CI/ESS/e2e/config.e2e.json:/usr/share/nginx/html/assets/config.json" - - "./CI/ESS/site.png:/usr/share/nginx/html/assets/images/site.png" - - "./CI/ESS/site-logo.png:/usr/share/nginx/html/assets/images/site-logo.png" - - "./CI/ESS/favicon.ico:/usr/share/nginx/html/favicon.ico" + - "./CI/e2e/frontend.config.e2e.json:/usr/share/nginx/html/assets/config.json" + # - "./CI/site.png:/usr/share/nginx/html/assets/images/site.png" + # - "./CI/site-logo.png:/usr/share/nginx/html/assets/images/site-logo.png" + # - "./CI/favicon.ico:/usr/share/nginx/html/favicon.ico" depends_on: - backend labels: diff --git a/CI/ESS/e2e/config.e2e.json b/CI/e2e/frontend.config.e2e.json similarity index 100% rename from CI/ESS/e2e/config.e2e.json rename to CI/e2e/frontend.config.e2e.json diff --git a/CI/ESS/e2e/functionalAccounts.json b/CI/e2e/functionalAccounts.e2e.json similarity index 100% rename from CI/ESS/e2e/functionalAccounts.json rename to CI/e2e/functionalAccounts.e2e.json diff --git a/CI/ESS/Dockerfile b/CI/to_be_deleted/ESS/Dockerfile similarity index 100% rename from CI/ESS/Dockerfile rename to CI/to_be_deleted/ESS/Dockerfile diff --git a/CI/ESS/Dockerfile.dmsc b/CI/to_be_deleted/ESS/Dockerfile.dmsc similarity index 100% rename from CI/ESS/Dockerfile.dmsc rename to CI/to_be_deleted/ESS/Dockerfile.dmsc diff --git a/CI/ESS/config.dev.json b/CI/to_be_deleted/ESS/config.dev.json similarity index 100% rename from CI/ESS/config.dev.json rename to CI/to_be_deleted/ESS/config.dev.json diff --git a/CI/ESS/config.ldpc.json b/CI/to_be_deleted/ESS/config.ldpc.json similarity index 100% rename from CI/ESS/config.ldpc.json rename to CI/to_be_deleted/ESS/config.ldpc.json diff --git a/CI/ESS/docker-compose.yaml b/CI/to_be_deleted/ESS/docker-compose.yaml similarity index 100% rename from CI/ESS/docker-compose.yaml rename to CI/to_be_deleted/ESS/docker-compose.yaml diff --git a/CI/ESS/esslogo-white.png b/CI/to_be_deleted/ESS/esslogo-white.png similarity index 100% rename from CI/ESS/esslogo-white.png rename to CI/to_be_deleted/ESS/esslogo-white.png diff --git a/CI/ESS/favicon.ico b/CI/to_be_deleted/ESS/favicon.ico similarity index 100% rename from CI/ESS/favicon.ico rename to CI/to_be_deleted/ESS/favicon.ico diff --git a/CI/ESS/scicat-logo-white.png b/CI/to_be_deleted/ESS/scicat-logo-white.png similarity index 100% rename from CI/ESS/scicat-logo-white.png rename to CI/to_be_deleted/ESS/scicat-logo-white.png diff --git a/CI/ESS/scicat-logo.png b/CI/to_be_deleted/ESS/scicat-logo.png similarity index 100% rename from CI/ESS/scicat-logo.png rename to CI/to_be_deleted/ESS/scicat-logo.png diff --git a/CI/ESS/site-logo.png b/CI/to_be_deleted/ESS/site-logo.png similarity index 100% rename from CI/ESS/site-logo.png rename to CI/to_be_deleted/ESS/site-logo.png diff --git a/CI/ESS/site.png b/CI/to_be_deleted/ESS/site.png similarity index 100% rename from CI/ESS/site.png rename to CI/to_be_deleted/ESS/site.png diff --git a/CI/ESS/styles.scss b/CI/to_be_deleted/ESS/styles.scss similarity index 100% rename from CI/ESS/styles.scss rename to CI/to_be_deleted/ESS/styles.scss diff --git a/CI/MAXIV/Dockerfile b/CI/to_be_deleted/MAXIV/Dockerfile similarity index 100% rename from CI/MAXIV/Dockerfile rename to CI/to_be_deleted/MAXIV/Dockerfile diff --git a/CI/MAXIV/docker-compose.yaml b/CI/to_be_deleted/MAXIV/docker-compose.yaml similarity index 100% rename from CI/MAXIV/docker-compose.yaml rename to CI/to_be_deleted/MAXIV/docker-compose.yaml diff --git a/CI/MAXIV/google-fonts/css/fonts.css b/CI/to_be_deleted/MAXIV/google-fonts/css/fonts.css similarity index 100% rename from CI/MAXIV/google-fonts/css/fonts.css rename to CI/to_be_deleted/MAXIV/google-fonts/css/fonts.css diff --git a/CI/MAXIV/google-fonts/css/material-icons.css b/CI/to_be_deleted/MAXIV/google-fonts/css/material-icons.css similarity index 100% rename from CI/MAXIV/google-fonts/css/material-icons.css rename to CI/to_be_deleted/MAXIV/google-fonts/css/material-icons.css diff --git a/CI/MAXIV/google-fonts/fonts/matrial-icon.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/matrial-icon.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/matrial-icon.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/matrial-icon.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-200.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-200.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-200.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-200.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-300.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-300.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-300.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-300.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-400-normal.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-400-normal.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-400-normal.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-400-normal.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-400.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-400.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-400.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-400.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-600-normal.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-600-normal.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-600-normal.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-600-normal.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-700-normal.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-700-normal.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-700-normal.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-700-normal.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-900-normal.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-900-normal.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-900-normal.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-900-normal.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-200.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-200.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-200.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-200.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-300.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-300.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-300.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-300.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-400-italic.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-400-italic.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-400-italic.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-400-italic.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-400.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-400.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-400.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-400.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-600-normal.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-600-normal.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-600-normal.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-600-normal.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-700-normal.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-700-normal.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-700-normal.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-700-normal.woff2 diff --git a/CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-900-normal.woff2 b/CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-900-normal.woff2 similarity index 100% rename from CI/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-900-normal.woff2 rename to CI/to_be_deleted/MAXIV/google-fonts/fonts/titillium-web-v10-latin-ext-900-normal.woff2 diff --git a/CI/MAXIV/index.html b/CI/to_be_deleted/MAXIV/index.html similarity index 100% rename from CI/MAXIV/index.html rename to CI/to_be_deleted/MAXIV/index.html diff --git a/CI/MAXIV/maxiv-favicon.ico b/CI/to_be_deleted/MAXIV/maxiv-favicon.ico similarity index 100% rename from CI/MAXIV/maxiv-favicon.ico rename to CI/to_be_deleted/MAXIV/maxiv-favicon.ico diff --git a/CI/MAXIV/maxiv-logo.png b/CI/to_be_deleted/MAXIV/maxiv-logo.png similarity index 100% rename from CI/MAXIV/maxiv-logo.png rename to CI/to_be_deleted/MAXIV/maxiv-logo.png diff --git a/CI/MAXIV/maxiv-site.png b/CI/to_be_deleted/MAXIV/maxiv-site.png similarity index 100% rename from CI/MAXIV/maxiv-site.png rename to CI/to_be_deleted/MAXIV/maxiv-site.png diff --git a/CI/MAXIV/maxiv-theme.scss b/CI/to_be_deleted/MAXIV/maxiv-theme.scss similarity index 100% rename from CI/MAXIV/maxiv-theme.scss rename to CI/to_be_deleted/MAXIV/maxiv-theme.scss diff --git a/CI/MAXIV/scicat-logo-white.png b/CI/to_be_deleted/MAXIV/scicat-logo-white.png similarity index 100% rename from CI/MAXIV/scicat-logo-white.png rename to CI/to_be_deleted/MAXIV/scicat-logo-white.png diff --git a/CI/MAXIV/scicat-logo.png b/CI/to_be_deleted/MAXIV/scicat-logo.png similarity index 100% rename from CI/MAXIV/scicat-logo.png rename to CI/to_be_deleted/MAXIV/scicat-logo.png diff --git a/CI/MAXIV/theme.json b/CI/to_be_deleted/MAXIV/theme.json similarity index 100% rename from CI/MAXIV/theme.json rename to CI/to_be_deleted/MAXIV/theme.json diff --git a/CI/MLZ/Dockerfile b/CI/to_be_deleted/MLZ/Dockerfile similarity index 100% rename from CI/MLZ/Dockerfile rename to CI/to_be_deleted/MLZ/Dockerfile diff --git a/CI/MLZ/Dockerfile.test b/CI/to_be_deleted/MLZ/Dockerfile.test similarity index 100% rename from CI/MLZ/Dockerfile.test rename to CI/to_be_deleted/MLZ/Dockerfile.test diff --git a/CI/MLZ/Dockerfile_dev b/CI/to_be_deleted/MLZ/Dockerfile_dev similarity index 100% rename from CI/MLZ/Dockerfile_dev rename to CI/to_be_deleted/MLZ/Dockerfile_dev diff --git a/CI/MLZ/Jenkinsfile b/CI/to_be_deleted/MLZ/Jenkinsfile similarity index 100% rename from CI/MLZ/Jenkinsfile rename to CI/to_be_deleted/MLZ/Jenkinsfile diff --git a/CI/MLZ/config.development.json b/CI/to_be_deleted/MLZ/config.development.json similarity index 100% rename from CI/MLZ/config.development.json rename to CI/to_be_deleted/MLZ/config.development.json diff --git a/CI/MLZ/config.prod.json b/CI/to_be_deleted/MLZ/config.prod.json similarity index 100% rename from CI/MLZ/config.prod.json rename to CI/to_be_deleted/MLZ/config.prod.json diff --git a/CI/MLZ/config.qa.json b/CI/to_be_deleted/MLZ/config.qa.json similarity index 100% rename from CI/MLZ/config.qa.json rename to CI/to_be_deleted/MLZ/config.qa.json diff --git a/CI/MLZ/copyimages.sh b/CI/to_be_deleted/MLZ/copyimages.sh similarity index 100% rename from CI/MLZ/copyimages.sh rename to CI/to_be_deleted/MLZ/copyimages.sh diff --git a/CI/MLZ/site-logo.png b/CI/to_be_deleted/MLZ/site-logo.png similarity index 100% rename from CI/MLZ/site-logo.png rename to CI/to_be_deleted/MLZ/site-logo.png diff --git a/CI/MLZ/site.png b/CI/to_be_deleted/MLZ/site.png similarity index 100% rename from CI/MLZ/site.png rename to CI/to_be_deleted/MLZ/site.png diff --git a/CI/PSI/Dockerfile b/CI/to_be_deleted/PSI/Dockerfile similarity index 100% rename from CI/PSI/Dockerfile rename to CI/to_be_deleted/PSI/Dockerfile diff --git a/CI/PSI/Dockerfile.test b/CI/to_be_deleted/PSI/Dockerfile.test similarity index 100% rename from CI/PSI/Dockerfile.test rename to CI/to_be_deleted/PSI/Dockerfile.test diff --git a/CI/PSI/Dockerfile_dev b/CI/to_be_deleted/PSI/Dockerfile_dev similarity index 100% rename from CI/PSI/Dockerfile_dev rename to CI/to_be_deleted/PSI/Dockerfile_dev diff --git a/CI/PSI/Jenkinsfile b/CI/to_be_deleted/PSI/Jenkinsfile similarity index 100% rename from CI/PSI/Jenkinsfile rename to CI/to_be_deleted/PSI/Jenkinsfile diff --git a/CI/PSI/config.development.json b/CI/to_be_deleted/PSI/config.development.json similarity index 100% rename from CI/PSI/config.development.json rename to CI/to_be_deleted/PSI/config.development.json diff --git a/CI/PSI/config.prod.json b/CI/to_be_deleted/PSI/config.prod.json similarity index 100% rename from CI/PSI/config.prod.json rename to CI/to_be_deleted/PSI/config.prod.json diff --git a/CI/PSI/config.qa.json b/CI/to_be_deleted/PSI/config.qa.json similarity index 100% rename from CI/PSI/config.qa.json rename to CI/to_be_deleted/PSI/config.qa.json diff --git a/CI/PSI/copyimages.sh b/CI/to_be_deleted/PSI/copyimages.sh similarity index 100% rename from CI/PSI/copyimages.sh rename to CI/to_be_deleted/PSI/copyimages.sh diff --git a/CI/PSI/site-logo.png b/CI/to_be_deleted/PSI/site-logo.png similarity index 100% rename from CI/PSI/site-logo.png rename to CI/to_be_deleted/PSI/site-logo.png diff --git a/CI/PSI/site.png b/CI/to_be_deleted/PSI/site.png similarity index 100% rename from CI/PSI/site.png rename to CI/to_be_deleted/PSI/site.png diff --git a/CI/RFI/Dockerfile b/CI/to_be_deleted/RFI/Dockerfile similarity index 100% rename from CI/RFI/Dockerfile rename to CI/to_be_deleted/RFI/Dockerfile diff --git a/CI/RFI/Dockerfile.dev b/CI/to_be_deleted/RFI/Dockerfile.dev similarity index 100% rename from CI/RFI/Dockerfile.dev rename to CI/to_be_deleted/RFI/Dockerfile.dev diff --git a/CI/RFI/config.dev.json b/CI/to_be_deleted/RFI/config.dev.json similarity index 100% rename from CI/RFI/config.dev.json rename to CI/to_be_deleted/RFI/config.dev.json diff --git a/CI/RFI/config.prod.json b/CI/to_be_deleted/RFI/config.prod.json similarity index 100% rename from CI/RFI/config.prod.json rename to CI/to_be_deleted/RFI/config.prod.json diff --git a/CI/RFI/config.staging.json b/CI/to_be_deleted/RFI/config.staging.json similarity index 100% rename from CI/RFI/config.staging.json rename to CI/to_be_deleted/RFI/config.staging.json diff --git a/CI/RFI/datasources.json b/CI/to_be_deleted/RFI/datasources.json similarity index 100% rename from CI/RFI/datasources.json rename to CI/to_be_deleted/RFI/datasources.json diff --git a/CI/RFI/docker-compose.yaml b/CI/to_be_deleted/RFI/docker-compose.yaml similarity index 100% rename from CI/RFI/docker-compose.yaml rename to CI/to_be_deleted/RFI/docker-compose.yaml diff --git a/CI/RFI/favicon.ico b/CI/to_be_deleted/RFI/favicon.ico similarity index 100% rename from CI/RFI/favicon.ico rename to CI/to_be_deleted/RFI/favicon.ico diff --git a/CI/RFI/karma.conf.js b/CI/to_be_deleted/RFI/karma.conf.js similarity index 100% rename from CI/RFI/karma.conf.js rename to CI/to_be_deleted/RFI/karma.conf.js diff --git a/CI/RFI/karma.specreport.js b/CI/to_be_deleted/RFI/karma.specreport.js similarity index 100% rename from CI/RFI/karma.specreport.js rename to CI/to_be_deleted/RFI/karma.specreport.js diff --git a/CI/RFI/providers.json b/CI/to_be_deleted/RFI/providers.json similarity index 100% rename from CI/RFI/providers.json rename to CI/to_be_deleted/RFI/providers.json diff --git a/CI/RFI/scicat-logo-white.png b/CI/to_be_deleted/RFI/scicat-logo-white.png similarity index 100% rename from CI/RFI/scicat-logo-white.png rename to CI/to_be_deleted/RFI/scicat-logo-white.png diff --git a/CI/RFI/scicat-logo.png b/CI/to_be_deleted/RFI/scicat-logo.png similarity index 100% rename from CI/RFI/scicat-logo.png rename to CI/to_be_deleted/RFI/scicat-logo.png diff --git a/CI/RFI/site-logo.png b/CI/to_be_deleted/RFI/site-logo.png similarity index 100% rename from CI/RFI/site-logo.png rename to CI/to_be_deleted/RFI/site-logo.png diff --git a/CI/RFI/site.png b/CI/to_be_deleted/RFI/site.png similarity index 100% rename from CI/RFI/site.png rename to CI/to_be_deleted/RFI/site.png diff --git a/CI/RFI/theme.scss b/CI/to_be_deleted/RFI/theme.scss similarity index 100% rename from CI/RFI/theme.scss rename to CI/to_be_deleted/RFI/theme.scss diff --git a/CI/ESS/e2e/cypress.config.ts b/CI/to_be_deleted/cypress.config.ts similarity index 100% rename from CI/ESS/e2e/cypress.config.ts rename to CI/to_be_deleted/cypress.config.ts diff --git a/CI/ESS/e2e/cypress.nestjs.ts b/CI/to_be_deleted/cypress.nestjs.ts similarity index 100% rename from CI/ESS/e2e/cypress.nestjs.ts rename to CI/to_be_deleted/cypress.nestjs.ts diff --git a/cypress.config.ts b/cypress.config.ts index fe43571ef..f757e94df 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from "cypress"; export default defineConfig({ e2e: { - baseUrl: "http://127.0.0.1:4200", + baseUrl: "http://localhost:4200", lbBaseUrl: "http://localhost:3000/api/v3", lbLoginEndpoint: "/auth/login", lbTokenPrefix: "Bearer ", diff --git a/package-lock.json b/package-lock.json index 96a39ac54..c95e100fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "@ngrx/effects": "^16", "@ngrx/router-store": "^16", "@ngrx/store": "^16", + "@scicatproject/scicat-sdk-ts": "^4.6.4", "autolinker": "^4.0.0", "deep-equal": "^2.0.5", "exceljs": "^4.3.0", @@ -4972,6 +4973,15 @@ "yarn": ">= 1.13.0" } }, + "node_modules/@scicatproject/scicat-sdk-ts": { + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/@scicatproject/scicat-sdk-ts/-/scicat-sdk-ts-4.6.4.tgz", + "integrity": "sha512-z4VEqWw3NhSXWTE7smIfZqUNAPGGExBD6EW1zDjaYWFQiMjS+peX2UBTztUMZpE7xQOBZkZ/x+rclNGSWfz7dA==", + "peerDependencies": { + "@angular/core": "^16.2.12", + "rxjs": "^7.4.0" + } + }, "node_modules/@sigstore/bundle": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-1.1.0.tgz", diff --git a/package.json b/package.json index 84a2f6190..ef8ab7199 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@ngrx/effects": "^16", "@ngrx/router-store": "^16", "@ngrx/store": "^16", + "@scicatproject/scicat-sdk-ts": "^4.6.4", "autolinker": "^4.0.0", "deep-equal": "^2.0.5", "exceljs": "^4.3.0", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 039a64785..3d40f52b9 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -24,6 +24,7 @@ import { MatChipsModule } from "@angular/material/chips"; import { MatSnackBarModule } from "@angular/material/snack-bar"; import { LayoutModule } from "_layout/layout.module"; import { AppConfigService } from "app-config.service"; +import { ApiModule } from "@scicatproject/scicat-sdk-ts"; import { AppThemeService } from "app-theme.service"; import { SnackbarInterceptor } from "shared/interceptors/snackbar.interceptor"; @@ -50,6 +51,7 @@ const appThemeInitializerFn = (appTheme: AppThemeService) => { MatChipsModule, MatSnackBarModule, SDKBrowserModule.forRoot(), + ApiModule, StoreModule.forRoot( { router: routerReducer, users: userReducer }, { From 50b7ff116a7f2de3fd3846533428f75e30a95fd7 Mon Sep 17 00:00:00 2001 From: junjiequan Date: Tue, 22 Oct 2024 13:05:16 +0200 Subject: [PATCH 2/9] fix failing e2e test --- CI/e2e/.env.scichat-loopback.e2e | 5 ++++ CI/e2e/docker-compose.e2e.yaml | 40 +++++++++++++++++++------------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/CI/e2e/.env.scichat-loopback.e2e b/CI/e2e/.env.scichat-loopback.e2e index e69de29bb..00471104d 100644 --- a/CI/e2e/.env.scichat-loopback.e2e +++ b/CI/e2e/.env.scichat-loopback.e2e @@ -0,0 +1,5 @@ +PORT: "" +SYNAPSE_SERVER_NAME: "" +SYNAPSE_SERVER_HOST: "" +SYNAPSE_BOT_NAME: "" +SYNAPSE_BOT_PASSWORD: "" diff --git a/CI/e2e/docker-compose.e2e.yaml b/CI/e2e/docker-compose.e2e.yaml index 740b1b57a..ba0f91be6 100644 --- a/CI/e2e/docker-compose.e2e.yaml +++ b/CI/e2e/docker-compose.e2e.yaml @@ -22,21 +22,6 @@ services: retries: 5 start_period: 40s - scichat-loopback: - image: "ghcr.io/scicatproject/scichat-loopback:latest" - command: - [ - "node", - "-r", - "dotenv/config", - "." - ] - volumes: - - "./CI/e2e/.env.scichat-loopback.e2e:/home/node/app/.env" - depends_on: - mongodb: - condition: service_healthy - backend: image: ghcr.io/scicatproject/backend-next:latest command: sh -c "node dist/main" @@ -45,7 +30,7 @@ services: volumes: - "./CI/e2e/.env.backend.e2e:/home/node/app/.env" - "./CI/e2e/functionalAccounts.e2e.json:/home/node/app/functionalAccounts.json" - - "./CI/e2e/config.e2e.json:/home/node/app/dist/config/frontend.config.json" + - "./CI/e2e/frontend.config.e2e.json:/home/node/app/dist/config/frontend.config.json" depends_on: mongodb: condition: service_healthy @@ -107,6 +92,29 @@ services: timeout: 10s start_period: 60s retries: 4 + + + ## NOTE: + ## scichat-loopback is ESS specific microservice for logbook + ## Discussion is needed to decide if this should be included in the e2e test + ## If not, remove the following block and also .env.scichat-loopback.e2e in the same directory + + + # scichat-loopback: + # image: "ghcr.io/scicatproject/scichat-loopback:latest" + # command: + # [ + # "node", + # "-r", + # "dotenv/config", + # "." + # ] + # volumes: + # - "./CI/e2e/.env.scichat-loopback.e2e:/home/node/app/.env" + # depends_on: + # mongodb: + # condition: service_healthy + volumes: mongodb_data: driver: local From 62a459d21995d6fc023b4f027bf094b2d97ab348 Mon Sep 17 00:00:00 2001 From: junjiequan Date: Tue, 22 Oct 2024 13:11:54 +0200 Subject: [PATCH 3/9] fix failing e2e test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index affeca844..6673eee61 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -130,7 +130,7 @@ jobs: - name: Run Cypress tests uses: cypress-io/github-action@v6 with: - config-file: CI/ESS/e2e/cypress.e2e.ts + config-file: CI/e2e/cypress.e2e.ts install-command: npm install --omit peer browser: chrome From 6153da439fe5bd0dce80e3ac7a1afc60907217a4 Mon Sep 17 00:00:00 2001 From: junjiequan Date: Tue, 22 Oct 2024 13:54:41 +0200 Subject: [PATCH 4/9] fix for cypress config type error & keep only one cypress config file for e2e test local/github --- CI/e2e/cypress.e2e.ts | 8 +++-- CI/e2e/frontend.config.e2e.json | 6 ++-- cypress.config.ts | 20 ----------- .../e2e/datasets/datasets-attachment.cy.js | 4 +-- cypress/e2e/datasets/datasets-datafiles.cy.js | 2 +- cypress/e2e/datasets/datasets-general.cy.js | 10 +++--- cypress/e2e/datasets/datasets-keyword.cy.js | 2 +- cypress/e2e/datasets/datasets-metadata.cy.js | 2 +- cypress/e2e/datasets/datasets-public.cy.js | 2 +- cypress/e2e/datasets/datasets-publish.cy.js | 2 +- cypress/e2e/datasets/datasets-reduce.cy.js | 2 +- cypress/e2e/datasets/datasets-share.cy.js | 8 ++--- cypress/e2e/other/policy-delegate.cy.js | 2 +- cypress/e2e/other/users-login.cy.js | 12 +++---- cypress/support/commands.js | 33 +++++++++---------- package.json | 4 +-- 16 files changed, 49 insertions(+), 70 deletions(-) delete mode 100644 cypress.config.ts diff --git a/CI/e2e/cypress.e2e.ts b/CI/e2e/cypress.e2e.ts index f757e94df..0e0788840 100644 --- a/CI/e2e/cypress.e2e.ts +++ b/CI/e2e/cypress.e2e.ts @@ -1,12 +1,10 @@ import { defineConfig } from "cypress"; export default defineConfig({ - e2e: { - baseUrl: "http://localhost:4200", + env: { lbBaseUrl: "http://localhost:3000/api/v3", lbLoginEndpoint: "/auth/login", lbTokenPrefix: "Bearer ", - viewportWidth: 1280, username: "admin", password: "27f5fd86ae68fe740eef42b8bbd1d7d5", secondaryUsername: "archiveManager", @@ -14,6 +12,10 @@ export default defineConfig({ guestUsername: "user1", guestUserEmail: "user1@your.site", guestPassword: "a609316768619f154ef58db4d847b75e", + }, + e2e: { + baseUrl: "http://localhost:4200", + viewportWidth: 1280, defaultCommandTimeout: 10000, retries: 1, }, diff --git a/CI/e2e/frontend.config.e2e.json b/CI/e2e/frontend.config.e2e.json index fddea7c0a..3dd641ac9 100644 --- a/CI/e2e/frontend.config.e2e.json +++ b/CI/e2e/frontend.config.e2e.json @@ -32,7 +32,7 @@ "maxDirectDownloadSize": 1047521824, "metadataPreviewEnabled": true, "metadataStructure": "", - "multipleDownloadAction": "http:/127.0.0.1:3012/zip", + "multipleDownloadAction": "http:/localhost/zip", "multipleDownloadEnabled": true, "oAuth2Endpoints": [ { @@ -42,12 +42,12 @@ ], "policiesEnabled": true, "retrieveDestinations": [], - "riotBaseUrl": "http://scichat.esss.lu.se", + "riotBaseUrl": "", "scienceSearchEnabled": true, "scienceSearchUnitsEnabled": true, "searchPublicDataEnabled": true, "searchSamples": true, - "sftpHost": "login.esss.dk", + "sftpHost": "", "shareEnabled": true, "shoppingCartEnabled": true, "shoppingCartOnHeader": true, diff --git a/cypress.config.ts b/cypress.config.ts deleted file mode 100644 index f757e94df..000000000 --- a/cypress.config.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { defineConfig } from "cypress"; - -export default defineConfig({ - e2e: { - baseUrl: "http://localhost:4200", - lbBaseUrl: "http://localhost:3000/api/v3", - lbLoginEndpoint: "/auth/login", - lbTokenPrefix: "Bearer ", - viewportWidth: 1280, - username: "admin", - password: "27f5fd86ae68fe740eef42b8bbd1d7d5", - secondaryUsername: "archiveManager", - secondaryPassword: "6d3b76392e6f41b087c11f8b77e3f9de", - guestUsername: "user1", - guestUserEmail: "user1@your.site", - guestPassword: "a609316768619f154ef58db4d847b75e", - defaultCommandTimeout: 10000, - retries: 1, - }, -}); diff --git a/cypress/e2e/datasets/datasets-attachment.cy.js b/cypress/e2e/datasets/datasets-attachment.cy.js index bca7e4a70..ca25eb5cd 100644 --- a/cypress/e2e/datasets/datasets-attachment.cy.js +++ b/cypress/e2e/datasets/datasets-attachment.cy.js @@ -3,7 +3,7 @@ var path = require("path"); describe("Dataset attachments", () => { beforeEach(() => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); cy.intercept("POST", "/api/v3/Datasets/**/*").as("upload"); }); @@ -72,7 +72,7 @@ describe("Dataset attachments", () => { cy.get(".download-button").click(); - const downloadsFolder = Cypress.config("downloadsFolder"); + const downloadsFolder = Cypress.env("downloadsFolder"); cy.readFile(path.join(downloadsFolder, "scicat-logo.png")).should( "exist", ); diff --git a/cypress/e2e/datasets/datasets-datafiles.cy.js b/cypress/e2e/datasets/datasets-datafiles.cy.js index 82099124a..642b522a0 100644 --- a/cypress/e2e/datasets/datasets-datafiles.cy.js +++ b/cypress/e2e/datasets/datasets-datafiles.cy.js @@ -2,7 +2,7 @@ describe("Dataset datafiles", () => { beforeEach(() => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); cy.intercept("PATCH", "/api/v3/Datasets/**/*").as("change"); cy.intercept("GET", "*").as("fetch"); }); diff --git a/cypress/e2e/datasets/datasets-general.cy.js b/cypress/e2e/datasets/datasets-general.cy.js index bd9251ade..b07e68b8a 100644 --- a/cypress/e2e/datasets/datasets-general.cy.js +++ b/cypress/e2e/datasets/datasets-general.cy.js @@ -2,7 +2,7 @@ describe("Datasets general", () => { beforeEach(() => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); }); after(() => { @@ -11,8 +11,8 @@ describe("Datasets general", () => { describe("Show dataset table after logout and login", () => { it("should be able to see datasets after visiting details page logout and login again", () => { - const username = Cypress.config("username"); - const password = Cypress.config("password"); + const username = Cypress.env("username"); + const password = Cypress.env("password"); cy.createDataset("raw"); @@ -86,8 +86,8 @@ describe("Datasets general", () => { cy.contains("A minimal test proposal"); cy.login( - Cypress.config("secondaryUsername"), - Cypress.config("secondaryPassword"), + Cypress.env("secondaryUsername"), + Cypress.env("secondaryPassword"), ); cy.deleteProposal(proposalId); diff --git a/cypress/e2e/datasets/datasets-keyword.cy.js b/cypress/e2e/datasets/datasets-keyword.cy.js index 5c62238e0..6f7b4af27 100644 --- a/cypress/e2e/datasets/datasets-keyword.cy.js +++ b/cypress/e2e/datasets/datasets-keyword.cy.js @@ -2,7 +2,7 @@ describe("Datasets", () => { beforeEach(() => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); cy.intercept("PATCH", "/api/v3/Datasets/**/*").as("keyword"); cy.intercept("GET", "*").as("fetch"); diff --git a/cypress/e2e/datasets/datasets-metadata.cy.js b/cypress/e2e/datasets/datasets-metadata.cy.js index 64068c055..469999830 100644 --- a/cypress/e2e/datasets/datasets-metadata.cy.js +++ b/cypress/e2e/datasets/datasets-metadata.cy.js @@ -12,7 +12,7 @@ describe("Datasets", () => { const metadataInvalidUnitValue = "invalidUnit"; beforeEach(() => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); cy.intercept("PATCH", "/api/v3/Datasets/**/*").as("metadata"); cy.intercept("GET", "*").as("fetch"); diff --git a/cypress/e2e/datasets/datasets-public.cy.js b/cypress/e2e/datasets/datasets-public.cy.js index e010e0e88..77d36455e 100644 --- a/cypress/e2e/datasets/datasets-public.cy.js +++ b/cypress/e2e/datasets/datasets-public.cy.js @@ -2,7 +2,7 @@ describe("Datasets", () => { beforeEach(() => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); cy.createDataset("raw"); diff --git a/cypress/e2e/datasets/datasets-publish.cy.js b/cypress/e2e/datasets/datasets-publish.cy.js index 962c64f01..a6c07b1fe 100644 --- a/cypress/e2e/datasets/datasets-publish.cy.js +++ b/cypress/e2e/datasets/datasets-publish.cy.js @@ -2,7 +2,7 @@ describe("Datasets", () => { beforeEach(() => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); }); after(() => { diff --git a/cypress/e2e/datasets/datasets-reduce.cy.js b/cypress/e2e/datasets/datasets-reduce.cy.js index ee1b6f64d..9aefe9111 100644 --- a/cypress/e2e/datasets/datasets-reduce.cy.js +++ b/cypress/e2e/datasets/datasets-reduce.cy.js @@ -2,7 +2,7 @@ describe("Datasets", () => { beforeEach(() => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); cy.intercept("PATCH", "/api/v3/Datasets/**/*").as("metadata"); cy.intercept("GET", "*").as("fetch"); diff --git a/cypress/e2e/datasets/datasets-share.cy.js b/cypress/e2e/datasets/datasets-share.cy.js index e5acafbbe..8ee8e3ebc 100644 --- a/cypress/e2e/datasets/datasets-share.cy.js +++ b/cypress/e2e/datasets/datasets-share.cy.js @@ -2,7 +2,7 @@ describe("Datasets", () => { beforeEach(() => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); }); after(() => { @@ -35,13 +35,13 @@ describe("Datasets", () => { cy.get("#shareButton").click(); - cy.get("#userEmailField").type(Cypress.config("guestUserEmail")); + cy.get("#userEmailField").type(Cypress.env("guestUserEmail")); cy.get("#addUserButton").click(); cy.get("mat-dialog-content mat-chip-listbox mat-chip-option") .first() - .should("contain.text", Cypress.config("guestUserEmail")); + .should("contain.text", Cypress.env("guestUserEmail")); cy.get("#shareListButton").should("not.be.disabled"); cy.get("#shareListButton").click(); @@ -52,7 +52,7 @@ describe("Datasets", () => { cy.get("mat-dialog-content mat-chip-listbox mat-chip-option") .first() - .should("contain.text", Cypress.config("guestUserEmail")); + .should("contain.text", Cypress.env("guestUserEmail")); cy.get("#removeAllButton").should("not.be.disabled"); cy.get("#removeAllButton").click(); diff --git a/cypress/e2e/other/policy-delegate.cy.js b/cypress/e2e/other/policy-delegate.cy.js index 57f708116..f20be665f 100644 --- a/cypress/e2e/other/policy-delegate.cy.js +++ b/cypress/e2e/other/policy-delegate.cy.js @@ -2,7 +2,7 @@ describe("Policies", () => { beforeEach(() => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); cy.intercept("POST", "/api/v3/Policies/**/*").as("update"); cy.intercept("GET", "*").as("fetch"); diff --git a/cypress/e2e/other/users-login.cy.js b/cypress/e2e/other/users-login.cy.js index cbe126c86..298927ce9 100644 --- a/cypress/e2e/other/users-login.cy.js +++ b/cypress/e2e/other/users-login.cy.js @@ -1,13 +1,13 @@ /// describe("Users Login", () => { - const username = Cypress.config("username"); - const password = Cypress.config("password"); + const username = Cypress.env("username"); + const password = Cypress.env("password"); - const guestUsername = Cypress.config("guestUsername"); - const guestPassword = Cypress.config("guestPassword"); + const guestUsername = Cypress.env("guestUsername"); + const guestPassword = Cypress.env("guestPassword"); - const loginEndpoint = Cypress.config("lbLoginEndpoint"); + const loginEndpoint = Cypress.env("lbLoginEndpoint"); beforeEach(() => { cy.intercept("POST", "**/auth/msad").as("adLogin"); @@ -44,7 +44,7 @@ describe("Users Login", () => { expect(request.method).to.eq("POST"); if (response.statusCode === 500) { cy.contains( - "Unable to connect to the authentication service. Please try again later or contact website maintainer." + "Unable to connect to the authentication service. Please try again later or contact website maintainer.", ); } }); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index f1eb5e768..5921893cb 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -1,8 +1,8 @@ import { testData } from "../fixtures/testData"; -const lbBaseUrl = Cypress.config("lbBaseUrl"); -const loginEndpoint = Cypress.config("lbLoginEndpoint"); -const accessTokenPrefix = Cypress.config("lbTokenPrefix"); +const lbBaseUrl = Cypress.env("lbBaseUrl"); +const loginEndpoint = Cypress.env("lbLoginEndpoint"); +const accessTokenPrefix = Cypress.env("lbTokenPrefix"); Cypress.Commands.add("login", (username, password) => { cy.request("POST", lbBaseUrl + loginEndpoint, { @@ -51,7 +51,7 @@ Cypress.Commands.add("createPolicy", (ownerGroup) => { }); Cypress.Commands.add("removePolicies", () => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); cy.getCookie("$LoopBackSDK$id").then((cookie) => { const token = cookie.value; @@ -73,8 +73,8 @@ Cypress.Commands.add("removePolicies", () => { .as("policies"); cy.login( - Cypress.config("secondaryUsername"), - Cypress.config("secondaryPassword"), + Cypress.env("secondaryUsername"), + Cypress.env("secondaryPassword"), ); cy.getCookie("$LoopBackSDK$id").then((deletionCookie) => { const deletionToken = deletionCookie.value; @@ -218,10 +218,7 @@ Cypress.Commands.add("deleteProposal", (id) => { }); Cypress.Commands.add("removeDatasets", () => { - cy.login( - Cypress.config("secondaryUsername"), - Cypress.config("secondaryPassword"), - ); + cy.login(Cypress.env("secondaryUsername"), Cypress.env("secondaryPassword")); cy.getCookie("$LoopBackSDK$id").then((cookie) => { const token = cookie.value; @@ -259,7 +256,7 @@ Cypress.Commands.add("removeDatasets", () => { }); Cypress.Commands.add("removeSamples", () => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); cy.getCookie("$LoopBackSDK$id").then((cookie) => { const token = cookie.value; @@ -281,8 +278,8 @@ Cypress.Commands.add("removeSamples", () => { .as("samples"); cy.login( - Cypress.config("secondaryUsername"), - Cypress.config("secondaryPassword"), + Cypress.env("secondaryUsername"), + Cypress.env("secondaryPassword"), ); cy.getCookie("$LoopBackSDK$id").then((deletionCookie) => { const deletionToken = deletionCookie.value; @@ -304,7 +301,7 @@ Cypress.Commands.add("removeSamples", () => { }); Cypress.Commands.add("initializeElasticSearch", (index) => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); cy.getCookie("$LoopBackSDK$id").then((idCookie) => { const token = idCookie.value; @@ -358,7 +355,7 @@ Cypress.Commands.add("createDatasetForElasticSearch", (datasetName) => { }); Cypress.Commands.add("removeElasticSearchIndex", (index) => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); cy.getCookie("$LoopBackSDK$id").then((idCookie) => { const token = idCookie.value; cy.request({ @@ -374,7 +371,7 @@ Cypress.Commands.add("removeElasticSearchIndex", (index) => { }); Cypress.Commands.add("removeDatasetsForElasticSearch", (datasetName) => { - cy.login(Cypress.config("username"), Cypress.config("password")); + cy.login(Cypress.env("username"), Cypress.env("password")); cy.getCookie("$LoopBackSDK$id").then((cookie) => { const token = cookie.value; @@ -396,8 +393,8 @@ Cypress.Commands.add("removeDatasetsForElasticSearch", (datasetName) => { .as("datasets"); cy.login( - Cypress.config("secondaryUsername"), - Cypress.config("secondaryPassword"), + Cypress.env("secondaryUsername"), + Cypress.env("secondaryPassword"), ); cy.getCookie("$LoopBackSDK$id").then((deletionCookie) => { const token = deletionCookie.value; diff --git a/package.json b/package.json index ef8ab7199..533303b51 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "lint": "ng lint", "lint:fix": "ng lint --fix", "betterer": "betterer", - "cypress:open": "cypress open", - "cypress:run": "cypress run" + "cypress:open": "cypress open -C ./CI/e2e/cypress.e2e.ts", + "cypress:run": "cypress run -C ./CI/e2e/cypress.e2e.ts" }, "private": true, "dependencies": { From 0616fc9e5f8bc2903340b4dc3f5550ebd21ef106 Mon Sep 17 00:00:00 2001 From: junjiequan Date: Tue, 22 Oct 2024 14:31:36 +0200 Subject: [PATCH 5/9] fix jesmine asserstion fake error --- tsconfig.json | 3 ++- tsconfig.spec.json | 15 +++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 8fcb0040e..a3245c745 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -28,5 +28,6 @@ "strictInjectionParameters": true, "strictInputAccessModifiers": true, "strictTemplates": true - } + }, + "exclude": ["cypress/**/*.ts", "cypress.config.ts"] } diff --git a/tsconfig.spec.json b/tsconfig.spec.json index 6b6ed1e8c..c7f4bad7c 100644 --- a/tsconfig.spec.json +++ b/tsconfig.spec.json @@ -3,17 +3,8 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/spec", - "types": [ - "jasmine", - "node" - ] + "types": ["jasmine", "node"] }, - "files": [ - "src/test.ts", - "src/polyfills.ts" - ], - "include": [ - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] + "files": ["src/test.ts", "src/polyfills.ts"], + "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] } From b47ef6693aba6dbfedcb8852c13be53c67ce4810 Mon Sep 17 00:00:00 2001 From: junjiequan Date: Tue, 22 Oct 2024 14:31:58 +0200 Subject: [PATCH 6/9] keep only one cypress.config.ts --- .github/workflows/test.yml | 7 +------ CI/e2e/docker-compose.e2e.yaml | 3 --- CI/to_be_deleted/cypress.config.ts | 20 -------------------- CI/to_be_deleted/cypress.nestjs.ts | 20 -------------------- CI/e2e/cypress.e2e.ts => cypress.config.ts | 0 package.json | 4 ++-- 6 files changed, 3 insertions(+), 51 deletions(-) delete mode 100644 CI/to_be_deleted/cypress.config.ts delete mode 100644 CI/to_be_deleted/cypress.nestjs.ts rename CI/e2e/cypress.e2e.ts => cypress.config.ts (100%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6673eee61..e9707bfb7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,15 +122,10 @@ jobs: docker compose build --no-cache docker compose up -d - # - name: Wait for Backend - # run: | - # npm install -g wait-on - # wait-on http://localhost:3000/api/v3/health --timeout 200000 - - name: Run Cypress tests uses: cypress-io/github-action@v6 with: - config-file: CI/e2e/cypress.e2e.ts + config-file: cypress.config.ts install-command: npm install --omit peer browser: chrome diff --git a/CI/e2e/docker-compose.e2e.yaml b/CI/e2e/docker-compose.e2e.yaml index ba0f91be6..68d0ce04c 100644 --- a/CI/e2e/docker-compose.e2e.yaml +++ b/CI/e2e/docker-compose.e2e.yaml @@ -52,9 +52,6 @@ services: - 4200:80 volumes: - "./CI/e2e/frontend.config.e2e.json:/usr/share/nginx/html/assets/config.json" - # - "./CI/site.png:/usr/share/nginx/html/assets/images/site.png" - # - "./CI/site-logo.png:/usr/share/nginx/html/assets/images/site-logo.png" - # - "./CI/favicon.ico:/usr/share/nginx/html/favicon.ico" depends_on: - backend labels: diff --git a/CI/to_be_deleted/cypress.config.ts b/CI/to_be_deleted/cypress.config.ts deleted file mode 100644 index 63fd504ee..000000000 --- a/CI/to_be_deleted/cypress.config.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { defineConfig } from "cypress"; - -export default defineConfig({ - e2e: { - baseUrl: "http://localhost:4200", - lbBaseUrl: "http://localhost:3000/api/v3", - lbLoginEndpoint: "/auth/login?include=user", - lbTokenPrefix: "Bearer ", - viewportWidth: 1280, - username: "admin", - password: "27f5fd86ae68fe740eef42b8bbd1d7d5", - secondaryUsername: "archiveManager", - secondaryPassword: "6d3b76392e6f41b087c11f8b77e3f9de", - guestUsername: "user1", - guestUserEmail: "user1@your.site", - guestPassword: "a609316768619f154ef58db4d847b75e", - defaultCommandTimeout: 10000, - retries: 1, - }, -}); diff --git a/CI/to_be_deleted/cypress.nestjs.ts b/CI/to_be_deleted/cypress.nestjs.ts deleted file mode 100644 index 05fabbcc2..000000000 --- a/CI/to_be_deleted/cypress.nestjs.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { defineConfig } from "cypress"; - -export default defineConfig({ - e2e: { - baseUrl: "http://localhost:80", - lbBaseUrl: "http://localhost:80/api/v3", - lbLoginEndpoint: "/auth/login", - lbTokenPrefix: "Bearer ", - viewportWidth: 1280, - username: "admin", - password: "27f5fd86ae68fe740eef42b8bbd1d7d5", - secondaryUsername: "archiveManager", - secondaryPassword: "6d3b76392e6f41b087c11f8b77e3f9de", - guestUsername: "user1", - guestUserEmail: "user1@your.site", - guestPassword: "a609316768619f154ef58db4d847b75e", - defaultCommandTimeout: 10000, - retries: 1, - }, -}); diff --git a/CI/e2e/cypress.e2e.ts b/cypress.config.ts similarity index 100% rename from CI/e2e/cypress.e2e.ts rename to cypress.config.ts diff --git a/package.json b/package.json index 533303b51..ef8ab7199 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "lint": "ng lint", "lint:fix": "ng lint --fix", "betterer": "betterer", - "cypress:open": "cypress open -C ./CI/e2e/cypress.e2e.ts", - "cypress:run": "cypress run -C ./CI/e2e/cypress.e2e.ts" + "cypress:open": "cypress open", + "cypress:run": "cypress run" }, "private": true, "dependencies": { From 5ae4275da2413015f5edbfc81b0c222782c721ec Mon Sep 17 00:00:00 2001 From: junjiequan Date: Tue, 22 Oct 2024 14:46:28 +0200 Subject: [PATCH 7/9] fix failing e2e --- cypress/e2e/datasets/datasets-attachment.cy.js | 4 ++-- cypress/e2e/datasets/datasets-datafiles.cy.js | 2 +- cypress/e2e/datasets/datasets-general.cy.js | 2 +- cypress/e2e/datasets/datasets-keyword.cy.js | 2 +- cypress/e2e/datasets/datasets-metadata.cy.js | 2 +- cypress/e2e/datasets/datasets-public.cy.js | 2 +- cypress/e2e/datasets/datasets-publish.cy.js | 2 +- cypress/e2e/datasets/datasets-reduce.cy.js | 2 +- cypress/e2e/datasets/datasets-share.cy.js | 2 +- cypress/e2e/other/elastic-search.cy.js | 2 +- cypress/e2e/other/policy-delegate.cy.js | 2 +- cypress/e2e/other/users-login.cy.js | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cypress/e2e/datasets/datasets-attachment.cy.js b/cypress/e2e/datasets/datasets-attachment.cy.js index ca25eb5cd..99b8b6b97 100644 --- a/cypress/e2e/datasets/datasets-attachment.cy.js +++ b/cypress/e2e/datasets/datasets-attachment.cy.js @@ -1,4 +1,4 @@ -/// +/// var path = require("path"); describe("Dataset attachments", () => { @@ -72,7 +72,7 @@ describe("Dataset attachments", () => { cy.get(".download-button").click(); - const downloadsFolder = Cypress.env("downloadsFolder"); + const downloadsFolder = Cypress.config("downloadsFolder"); cy.readFile(path.join(downloadsFolder, "scicat-logo.png")).should( "exist", ); diff --git a/cypress/e2e/datasets/datasets-datafiles.cy.js b/cypress/e2e/datasets/datasets-datafiles.cy.js index 642b522a0..46c927424 100644 --- a/cypress/e2e/datasets/datasets-datafiles.cy.js +++ b/cypress/e2e/datasets/datasets-datafiles.cy.js @@ -1,4 +1,4 @@ -/// +/// describe("Dataset datafiles", () => { beforeEach(() => { diff --git a/cypress/e2e/datasets/datasets-general.cy.js b/cypress/e2e/datasets/datasets-general.cy.js index b07e68b8a..1a571f79f 100644 --- a/cypress/e2e/datasets/datasets-general.cy.js +++ b/cypress/e2e/datasets/datasets-general.cy.js @@ -1,4 +1,4 @@ -/// +/// describe("Datasets general", () => { beforeEach(() => { diff --git a/cypress/e2e/datasets/datasets-keyword.cy.js b/cypress/e2e/datasets/datasets-keyword.cy.js index 6f7b4af27..8e96e707c 100644 --- a/cypress/e2e/datasets/datasets-keyword.cy.js +++ b/cypress/e2e/datasets/datasets-keyword.cy.js @@ -1,4 +1,4 @@ -/// +/// describe("Datasets", () => { beforeEach(() => { diff --git a/cypress/e2e/datasets/datasets-metadata.cy.js b/cypress/e2e/datasets/datasets-metadata.cy.js index 469999830..3f61c3c07 100644 --- a/cypress/e2e/datasets/datasets-metadata.cy.js +++ b/cypress/e2e/datasets/datasets-metadata.cy.js @@ -1,4 +1,4 @@ -/// +/// describe("Datasets", () => { const metadataName = "some name"; diff --git a/cypress/e2e/datasets/datasets-public.cy.js b/cypress/e2e/datasets/datasets-public.cy.js index 77d36455e..ba8fbc13a 100644 --- a/cypress/e2e/datasets/datasets-public.cy.js +++ b/cypress/e2e/datasets/datasets-public.cy.js @@ -1,4 +1,4 @@ -/// +/// describe("Datasets", () => { beforeEach(() => { diff --git a/cypress/e2e/datasets/datasets-publish.cy.js b/cypress/e2e/datasets/datasets-publish.cy.js index a6c07b1fe..39ca01dd6 100644 --- a/cypress/e2e/datasets/datasets-publish.cy.js +++ b/cypress/e2e/datasets/datasets-publish.cy.js @@ -1,4 +1,4 @@ -/// +/// describe("Datasets", () => { beforeEach(() => { diff --git a/cypress/e2e/datasets/datasets-reduce.cy.js b/cypress/e2e/datasets/datasets-reduce.cy.js index 9aefe9111..31259ca05 100644 --- a/cypress/e2e/datasets/datasets-reduce.cy.js +++ b/cypress/e2e/datasets/datasets-reduce.cy.js @@ -1,4 +1,4 @@ -/// +/// describe("Datasets", () => { beforeEach(() => { diff --git a/cypress/e2e/datasets/datasets-share.cy.js b/cypress/e2e/datasets/datasets-share.cy.js index 8ee8e3ebc..860db076c 100644 --- a/cypress/e2e/datasets/datasets-share.cy.js +++ b/cypress/e2e/datasets/datasets-share.cy.js @@ -1,4 +1,4 @@ -/// +/// describe("Datasets", () => { beforeEach(() => { diff --git a/cypress/e2e/other/elastic-search.cy.js b/cypress/e2e/other/elastic-search.cy.js index bab35a464..416f9a03d 100644 --- a/cypress/e2e/other/elastic-search.cy.js +++ b/cypress/e2e/other/elastic-search.cy.js @@ -1,4 +1,4 @@ -/// +/// describe("Elastic search", () => { const randomText1 = diff --git a/cypress/e2e/other/policy-delegate.cy.js b/cypress/e2e/other/policy-delegate.cy.js index f20be665f..fd5fd4e98 100644 --- a/cypress/e2e/other/policy-delegate.cy.js +++ b/cypress/e2e/other/policy-delegate.cy.js @@ -1,4 +1,4 @@ -/// +/// describe("Policies", () => { beforeEach(() => { diff --git a/cypress/e2e/other/users-login.cy.js b/cypress/e2e/other/users-login.cy.js index 298927ce9..28e4de680 100644 --- a/cypress/e2e/other/users-login.cy.js +++ b/cypress/e2e/other/users-login.cy.js @@ -1,4 +1,4 @@ -/// +/// describe("Users Login", () => { const username = Cypress.env("username"); From 6223e676cb64a7b5252cb4dd99da45c3d7b7e28b Mon Sep 17 00:00:00 2001 From: junjiequan Date: Tue, 22 Oct 2024 14:51:04 +0200 Subject: [PATCH 8/9] revert scicat-sdk-ts import --- package-lock.json | 10 ---------- package.json | 1 - src/app/app.module.ts | 2 -- 3 files changed, 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index c95e100fc..96a39ac54 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,6 @@ "@ngrx/effects": "^16", "@ngrx/router-store": "^16", "@ngrx/store": "^16", - "@scicatproject/scicat-sdk-ts": "^4.6.4", "autolinker": "^4.0.0", "deep-equal": "^2.0.5", "exceljs": "^4.3.0", @@ -4973,15 +4972,6 @@ "yarn": ">= 1.13.0" } }, - "node_modules/@scicatproject/scicat-sdk-ts": { - "version": "4.6.4", - "resolved": "https://registry.npmjs.org/@scicatproject/scicat-sdk-ts/-/scicat-sdk-ts-4.6.4.tgz", - "integrity": "sha512-z4VEqWw3NhSXWTE7smIfZqUNAPGGExBD6EW1zDjaYWFQiMjS+peX2UBTztUMZpE7xQOBZkZ/x+rclNGSWfz7dA==", - "peerDependencies": { - "@angular/core": "^16.2.12", - "rxjs": "^7.4.0" - } - }, "node_modules/@sigstore/bundle": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-1.1.0.tgz", diff --git a/package.json b/package.json index ef8ab7199..84a2f6190 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "@ngrx/effects": "^16", "@ngrx/router-store": "^16", "@ngrx/store": "^16", - "@scicatproject/scicat-sdk-ts": "^4.6.4", "autolinker": "^4.0.0", "deep-equal": "^2.0.5", "exceljs": "^4.3.0", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 3d40f52b9..039a64785 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -24,7 +24,6 @@ import { MatChipsModule } from "@angular/material/chips"; import { MatSnackBarModule } from "@angular/material/snack-bar"; import { LayoutModule } from "_layout/layout.module"; import { AppConfigService } from "app-config.service"; -import { ApiModule } from "@scicatproject/scicat-sdk-ts"; import { AppThemeService } from "app-theme.service"; import { SnackbarInterceptor } from "shared/interceptors/snackbar.interceptor"; @@ -51,7 +50,6 @@ const appThemeInitializerFn = (appTheme: AppThemeService) => { MatChipsModule, MatSnackBarModule, SDKBrowserModule.forRoot(), - ApiModule, StoreModule.forRoot( { router: routerReducer, users: userReducer }, { From 741e582d923704c32018293f7c7f88a27ecaf0e5 Mon Sep 17 00:00:00 2001 From: junjiequan Date: Wed, 30 Oct 2024 12:39:38 +0100 Subject: [PATCH 9/9] fix for commented issues --- CI/e2e/docker-compose.e2e.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/CI/e2e/docker-compose.e2e.yaml b/CI/e2e/docker-compose.e2e.yaml index 68d0ce04c..10127aea4 100644 --- a/CI/e2e/docker-compose.e2e.yaml +++ b/CI/e2e/docker-compose.e2e.yaml @@ -24,7 +24,6 @@ services: backend: image: ghcr.io/scicatproject/backend-next:latest - command: sh -c "node dist/main" ports: - 3000:3000 volumes: @@ -47,7 +46,6 @@ services: frontend: build: context: . - dockerfile: Dockerfile ports: - 4200:80 volumes: