Skip to content

Commit 4d555c4

Browse files
authored
Merge pull request #483 from geichelberger/test-without-mocks
Test deployments without mocks
2 parents f5131d4 + b9ef719 commit 4d555c4

196 files changed

Lines changed: 18 additions & 10110 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
run: npm ci
2727

2828
- name: build project
29+
env:
30+
NODE_ENV: development
31+
VITE_TEST_SERVER_URL: "https://develop.opencast.org"
32+
VITE_TEST_SERVER_AUTH: "admin:opencast"
2933
run: npm run build
3034

3135
- name: create pages directory
@@ -34,10 +38,6 @@ jobs:
3438
- name: include admin interface
3539
run: mv build gh-pages/admin-ui
3640

37-
- name: include mock data
38-
working-directory: ./gh-pages
39-
run: cp -rv ../test/GET/* .
40-
4141
- name: include landing page
4242
run: cp .github/demo-page.html gh-pages/index.html
4343

.github/workflows/deploy-test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
- name: build app
3636
env:
3737
PUBLIC_URL: /${{ steps.build-path.outputs.build }}
38+
NODE_ENV: development
39+
VITE_TEST_SERVER_URL: "https://develop.opencast.org"
40+
VITE_TEST_SERVER_AUTH: "admin:opencast"
3841
run: npm run build
3942

4043
- name: prepare git
@@ -67,10 +70,6 @@ jobs:
6770
run: |
6871
git checkout gh-pages
6972
70-
- name: include mock data
71-
working-directory: admin-interface-test
72-
run: cp -rv ../test/GET/* .
73-
7473
- name: store build
7574
working-directory: admin-interface-test
7675
env:

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ PROXY_TARGET=http://localhost:8080 PROXY_AUTH=jdoe:aligator3 npm start
5050
Similarly, if you want to change the port the development server itself runs at,
5151
you can specify an alternative port in the `PORT` environment variable.
5252

53+
If you aim to test against a remote server without using a proxy, you have the option to configure the target server with the `VITE_TEST_SERVER_URL`, and the `VITE_TEST_SERVER_AUTH` environment variables while using the node development mode:
54+
55+
```sh
56+
NODE_ENV=development VITE_TEST_SERVER_URL="https://develop.opencast.org" VITE_TEST_SERVER_AUTH="admin:opencast" npm start
57+
```
5358

5459
How to cut a release for Opencast
5560
---------------------------------

src/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from "react";
22
import ReactDOMClient from "react-dom/client";
33
import "./index.css";
44
import App from "./App";
5+
import axios from "axios";
56

67
// redux imports
78
import { persistStore } from "redux-persist";
@@ -31,6 +32,11 @@ const theme = createTheme({
3132
}
3233
})
3334

35+
if (import.meta.env.DEV && import.meta.env.VITE_TEST_SERVER_URL) {
36+
axios.defaults.baseURL = import.meta.env.VITE_TEST_SERVER_URL || ""
37+
axios.defaults.headers.common['Authorization'] = import.meta.env.VITE_TEST_SERVER_AUTH && ("Basic " + window.btoa(import.meta.env.VITE_TEST_SERVER_AUTH));
38+
}
39+
3440
const container = document.getElementById("root");
3541
if (!container) {
3642
throw new Error("Failed to find the root element");

test/DELETE/admin-ng/event/c3a4f68d-14d4-47e2-8981-8eb2fb300d3a/workflows/1676

Whitespace-only changes.

test/DELETE/admin-ng/event/c3a4f68d-14d4-47e2-8981-8eb2fb300d3a/workflows/1677

Whitespace-only changes.

test/DELETE/admin-ng/event/c3a4f68d-14d4-47e2-8981-8eb2fb300d3a/workflows/1678

Whitespace-only changes.

test/DELETE/admin-ng/file/bumper/101

Whitespace-only changes.

test/DELETE/admin-ng/series/4581/theme

Whitespace-only changes.

test/DELETE/admin-ng/theme/1

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)