Skip to content
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
22 changes: 22 additions & 0 deletions .github/workflows/copilot-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Copilot Review

on:
pull_request:
types: [opened, ready_for_review]

jobs:
request-copilot-review:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Request Copilot Review
uses: actions/github-script@v7
with:
script: |
await github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
reviewers: ['copilot']
});
86 changes: 84 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,94 @@ jobs:
node --version
npm --version

# Run App Catalogue unit tets
# Run App Catalogue unit tests
- name: Run unit tests
timeout-minutes: 60
run: |
cd ts
NODE_OPTIONS="--max_old_space_size=8192" yarn test:ci
set +e
node --experimental-vm-modules \
./node_modules/jest/bin/jest.js --ci --maxWorkers=50% \
--config src/jest.config.ts --json --outputFile=test-results.json
TEST_EXIT_CODE=$?
set -e

if [ $TEST_EXIT_CODE -eq 0 ]; then
echo "All tests passed."
exit 0
fi

if [ ! -f test-results.json ]; then
echo "::error::Jest failed (exit code $TEST_EXIT_CODE) and produced no results file."
exit 1
fi

# Analyze failures: only tolerate transient network/timeout issues
python3 << 'PYEOF'
import json, sys, re

TRANSIENT_PATTERNS = [
r"Exceeded timeout of \d+ ms",
r"ECONNREFUSED",
r"ETIMEDOUT",
r"ENOTFOUND",
r"ECONNRESET",
r"EHOSTUNREACH",
r"EPIPE",
r"EAI_AGAIN",
r"socket hang up",
r"fetch failed",
r"network\s*(error|timeout|request failed)",
r"getaddrinfo",
r"connect ENETUNREACH",
r"\b502\b.*bad gateway",
r"\b503\b.*service unavailable",
r"\b504\b.*gateway timeout",
r"\b429\b.*too many requests",
r"rate limit",
]

try:
with open("test-results.json") as f:
data = json.load(f)
except (json.JSONDecodeError, OSError) as e:
print(f"::error::Failed to parse test-results.json: {e}")
sys.exit(1)

transient = []
real = []

for suite in data.get("testResults", []):
for test in suite.get("assertionResults", []):
if test.get("status") != "failed":
continue
msgs = " ".join(test.get("failureMessages", []))
name = " › ".join(test.get("ancestorTitles", []) + [test.get("title", "")])
if any(re.search(p, msgs, re.IGNORECASE) for p in TRANSIENT_PATTERNS):
transient.append(name)
else:
real.append(name)

if transient:
print(f"::warning::Ignoring {len(transient)} transient test failure(s) (timeouts/network errors):")
for t in transient:
print(f" - {t}")

if real:
print(f"::error::Found {len(real)} real test failure(s):")
for r in real:
print(f" - {r}")
sys.exit(1)

if not transient and not real:
# Jest failed but no individual test failures found — could be a
# config error, compilation failure, etc. Treat as real failure.
print("::error::Jest failed but no individual test results were found in the output.")
sys.exit(1)

print("All failures are transient network/timeout issues — continuing pipeline.")
sys.exit(0)
PYEOF
env:
NODE_OPTIONS: "--max_old_space_size=8192"

Expand Down
51 changes: 51 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
stages:
- test

default:
tags:
- k8s
- amd64
before_script:
- |
curl "https://api.github.com/repos/qoretechnologies/${REPO_NAME}/statuses/${CI_COMMIT_SHA}" \
-X POST --oauth2-bearer ${GITHUB_ACCESS_TOKEN} -H "Content-Type: application/json" \
-d "{\"state\": \"pending\", \"context\": \"${REPO_NAME}\", \"description\": \"Gitlab CI\", \"target_url\": \"${CI_JOB_URL}\"}"
- set +e

variables:
REPO_NAME: module-v8
GIT_SUBMODULE_STRATEGY: recursive

test-ubuntu:
stage: test
image: $CI_REGISTRY/infrastructure/qore-test-base/qore-test-base:develop
script:
- |
if test/docker_test/test-ubuntu.sh; then
curl "https://api.github.com/repos/qoretechnologies/${REPO_NAME}/statuses/${CI_COMMIT_SHA}" \
-X POST --oauth2-bearer ${GITHUB_ACCESS_TOKEN} -H "Content-Type: application/json" \
-d "{\"state\": \"success\", \"context\": \"${REPO_NAME}\", \"description\": \"Gitlab CI\", \"target_url\": \"${CI_JOB_URL}\"}"
exit 0
else
curl "https://api.github.com/repos/qoretechnologies/${REPO_NAME}/statuses/${CI_COMMIT_SHA}" \
-X POST --oauth2-bearer ${GITHUB_ACCESS_TOKEN} -H "Content-Type: application/json" \
-d "{\"state\": \"failure\", \"context\": \"${REPO_NAME}\", \"description\": \"Gitlab CI\", \"target_url\": \"${CI_JOB_URL}\"}"
exit 1
fi

test-alpine:
stage: test
image: $CI_REGISTRY/infrastructure/qore-test-base/qore-test-base:develop-alpine
script:
- |
if test/docker_test/test-alpine.sh; then
curl "https://api.github.com/repos/qoretechnologies/${REPO_NAME}/statuses/${CI_COMMIT_SHA}" \
-X POST --oauth2-bearer ${GITHUB_ACCESS_TOKEN} -H "Content-Type: application/json" \
-d "{\"state\": \"success\", \"context\": \"${REPO_NAME}\", \"description\": \"Gitlab CI\", \"target_url\": \"${CI_JOB_URL}\"}"
exit 0
else
curl "https://api.github.com/repos/qoretechnologies/${REPO_NAME}/statuses/${CI_COMMIT_SHA}" \
-X POST --oauth2-bearer ${GITHUB_ACCESS_TOKEN} -H "Content-Type: application/json" \
-d "{\"state\": \"failure\", \"context\": \"${REPO_NAME}\", \"description\": \"Gitlab CI\", \"target_url\": \"${CI_JOB_URL}\"}"
exit 1
fi
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ set(CPP_SRC
src/QoreV8CallStack.cpp
src/QoreV8StackLocationHelper.cpp
src/QoreV8CallReference.cpp
src/QoreV8NamespaceWrapper.cpp
src/QoreV8ClassWrapper.cpp
)

set(QMOD
Expand Down
Loading
Loading