Skip to content

Task/auto testing #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/build-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm test
- name: Install dependencies
run: find . -name 'package-lock.json' -execdir npm ci \;
- name: Run server
run: npm start &
- name: Wait for server to start
run: npx wait-on tcp:8585
- name: Run tests
run: npm run test
build-latest:
name: Build branch
runs-on: ubuntu-latest
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/build-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm test
- name: Install dependencies
run: find . -name 'package-lock.json' -execdir npm ci \;
- name: Run server
run: npm start &
- name: Wait for server to start
run: npx wait-on tcp:8585
- name: Run tests
run: npm run test
build-latest:
name: Build latest
runs-on: ubuntu-latest
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm test
- name: Install dependencies
run: find . -name 'package-lock.json' -execdir npm ci \;
- name: Run server
run: npm start &
- name: Wait for server to start
run: npx wait-on tcp:8585
- name: Run tests
run: npm run test
build:
name: Build with google cloud
runs-on: ubuntu-latest
Expand Down
34 changes: 33 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"start": "node app.js",
"dev": "nodemon --inspect=0.0.0.0:9229 app.js",
"test": "vitest run"
"test": "vitest"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -37,7 +37,8 @@
"pino-http": "^9.0.0",
"pino-pretty": "^10.3.1",
"swagger-ui-express": "^5.0.0",
"vitest": "^0.34.6"
"vitest": "^0.34.6",
"wait-on": "^7.2.0"
},
"devDependencies": {
"@types/express": "^4.17.18",
Expand Down
3 changes: 2 additions & 1 deletion src/lib/setup-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ dotenv.config();
const rootDir = resolve();
let allResources = null; // This will store the entire resources tree.

const port = process.env.PORT || 8585;
const port =
process.env.PORT_OVERRIDE || process.env.ONIFY_API_INTERNAL_PORT || 8585;
const resourcesSource = process.env.ONIFY_API_RESOURCES_SOURCE || '/';
const resourceURL = `${process.env.ONIFY_API_URL}/admin/resources/file?stream=false&path=${resourcesSource}`;
const listResourcesURL = `${process.env.ONIFY_API_URL}/admin/resources?tree=true`;
Expand Down
Loading