Skip to content

Commit

Permalink
adjust deployment, fix api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinOehlerkingCap committed Aug 8, 2024
1 parent d3d5150 commit a269fe9
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
1 change: 0 additions & 1 deletion ansible/group_vars/develop/shd-client.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
PORT: 4100
SHD_CLIENT_IMAGE: ghcr.io/hpi-schul-cloud/shd-client
SHD_CLIENT_PREFIX: shd2-
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
PORT: 4100
SHD_CLIENT_IMAGE: quay.io/schulcloudverbund/shd-client
SHD_CLIENT_PREFIX: dashboard2.
2 changes: 0 additions & 2 deletions ansible/roles/shd-client-core/templates/configmap.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ metadata:
labels:
app: shd-client
data:
# general
NODE_ENV: "production"
TZ: "Europe/Berlin"
API_URL: "https://{{ DOMAIN }}/api"
4 changes: 2 additions & 2 deletions ansible/roles/shd-client-core/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ spec:
resources:
limits:
cpu: {{ SHD_CLIENT_CPU_LIMITS|default("1000m", true) }}
memory: {{ SHD_CLIENT_MEMORY_LIMITS|default("256Mi", true) }}
memory: {{ SHD_CLIENT_MEMORY_LIMITS|default("2Gi", true) }}
requests:
cpu: {{ SHD_CLIENT_CPU_REQUESTS|default("100m", true) }}
memory: {{ SHD_CLIENT_MEMORY_REQUESTS|default("32Mi", true) }}
memory: {{ SHD_CLIENT_MEMORY_REQUESTS|default("128Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/shd-client-core/templates/ingress.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ spec:
service:
name: shd-client-svc
port:
number: {{ PORT }}
number: 4100
2 changes: 1 addition & 1 deletion ansible/roles/shd-client-core/templates/svc.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
spec:
type: ClusterIP
ports:
- port: {{ PORT }}
- port: 4100
targetPort: 4100
protocol: TCP
name: shd-client
Expand Down
8 changes: 4 additions & 4 deletions src/modules/data/auth/auth.store.unit.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import * as serverApi from "@/serverApi/v3/api";
import * as serverMeApi from "@/serverApi/v3/api/me-api";
import { meResponseFactory } from "@@/tests/test-utils/factory";
import { mockApiResponse } from "@@/tests/test-utils/mockApiResponse";
import { createMock, DeepMocked } from "@golevelup/ts-jest";
import { createPinia, setActivePinia } from "pinia";
import { useAuthStore } from "./auth.store";

describe("AuthStore", () => {
let meApi: DeepMocked<serverApi.MeApiInterface>;
let meApi: DeepMocked<serverMeApi.MeApiInterface>;

beforeEach(() => {
setActivePinia(createPinia());

meApi = createMock<serverApi.MeApiInterface>();
meApi = createMock<serverMeApi.MeApiInterface>();

jest.spyOn(serverApi, "MeApiFactory").mockReturnValue(meApi);
jest.spyOn(serverMeApi, "MeApiFactory").mockReturnValue(meApi);
});

afterEach(() => {
Expand Down
10 changes: 6 additions & 4 deletions src/modules/data/env-config/envConfig.store.unit.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import * as serverApi from "@/serverApi/v3/api";
import * as serverDefaultApi from "@/serverApi/v3/api/default-api";
import { envsFactory } from "@@/tests/test-utils/factory";
import { mockApiResponse } from "@@/tests/test-utils/mockApiResponse";
import { createMock, DeepMocked } from "@golevelup/ts-jest";
import { createPinia, setActivePinia } from "pinia";
import { useEnvConfigStore } from "./envConfig.store";

describe("EnvConfigStore", () => {
let defaultApi: DeepMocked<serverApi.DefaultApiInterface>;
let defaultApi: DeepMocked<serverDefaultApi.DefaultApiInterface>;

beforeEach(() => {
setActivePinia(createPinia());

defaultApi = createMock<serverApi.DefaultApiInterface>();
defaultApi = createMock<serverDefaultApi.DefaultApiInterface>();

jest.spyOn(serverApi, "DefaultApiFactory").mockReturnValue(defaultApi);
jest
.spyOn(serverDefaultApi, "DefaultApiFactory")
.mockReturnValue(defaultApi);
});

afterEach(() => {
Expand Down

0 comments on commit a269fe9

Please sign in to comment.