Skip to content

Commit

Permalink
echo to GITHUB_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
csmig committed Feb 27, 2025
1 parent 0208d43 commit 7dfc762
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/api-state-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ jobs:
run: npm ci
- name: Run tests
working-directory: ./test/state
run: npm test
run: |
echo "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" >>> $GITHUB_PATH
npm test
- name: Upload mocha test report
id: artifact-upload-mocha
uses: actions/upload-artifact@v4
Expand Down
14 changes: 7 additions & 7 deletions test/state/mocha/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { dirname } from 'path'
import { fileURLToPath } from 'url'
const __dirname = dirname(fileURLToPath(import.meta.url))

const nodePath = '/usr/local/bin/node'
const pythonPath = '/usr/bin/python3'
const dockerPath = '/usr/bin/docker'
const nodeCmd = 'node'
const pythonCmd = 'python3'
const dockerCmd = 'docker'

export async function spawnApiWait (env) {
return new Promise((resolve, reject) => {
const api = spawn(nodePath, [`${__dirname}/../../../api/source/index.js`], {env})
const api = spawn(nodeCmd, [`${__dirname}/../../../api/source/index.js`], {env})

api.on('error', (err) => {
reject(err)
Expand Down Expand Up @@ -42,7 +42,7 @@ export async function spawnApiWait (env) {

export async function spawnApi (env) {
return new Promise((resolve, reject) => {
const api = spawn(nodePath, [`${__dirname}/../../../api/source/index.js`], {env})
const api = spawn(nodeCmd, [`${__dirname}/../../../api/source/index.js`], {env})

api.on('error', (err) => {
reject(err)
Expand Down Expand Up @@ -105,7 +105,7 @@ export async function simpleRequest(url, method) {
export function spawnMySQL (tag = '8.0.41', port = '3306') {
let readyCount = 0
return new Promise((resolve, reject) => {
const child = spawn(dockerPath, [
const child = spawn(dockerCmd, [
'run', '--rm',
// '--name', 'test-mysql',
'-p', `${port}:3306`,
Expand Down Expand Up @@ -148,7 +148,7 @@ export function spawnMySQL (tag = '8.0.41', port = '3306') {
}

export function spawnMockKeycloak (port = '8080') {
const child = spawn(pythonPath, ['-m', 'http.server', port], {cwd: `${__dirname}/../../api/mock-keycloak`})
const child = spawn(pythonCmd, ['-m', 'http.server', port], {cwd: `${__dirname}/../../api/mock-keycloak`})
// child.on('exit', (code) => {
// console.log(`EXIT: Mock Keycloak server exited with code ${code}`);
// })
Expand Down

0 comments on commit 7dfc762

Please sign in to comment.