Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
78c9172
testing
VanshikaSabharwal Mar 11, 2026
2f99088
testing
VanshikaSabharwal Mar 11, 2026
660ceef
testing
VanshikaSabharwal Mar 11, 2026
7d604e3
added debug
VanshikaSabharwal Mar 12, 2026
3a37951
added debug
VanshikaSabharwal Mar 12, 2026
179b88b
removed debug librabry
VanshikaSabharwal Mar 12, 2026
fa4b006
added env
VanshikaSabharwal Mar 12, 2026
d049822
added env
VanshikaSabharwal Mar 12, 2026
6491307
added env
VanshikaSabharwal Mar 12, 2026
e712eb8
updated install path
VanshikaSabharwal Mar 12, 2026
7f40509
updated install path
VanshikaSabharwal Mar 12, 2026
faf75b1
fixed integration tests check
VanshikaSabharwal Mar 12, 2026
6cc281b
fixed integration tests check
VanshikaSabharwal Mar 12, 2026
7c3dce3
testing by removing the --debug form install script
VanshikaSabharwal Mar 12, 2026
3842f1c
added fix for npm permissions
VanshikaSabharwal Mar 12, 2026
20dcf92
testing playwright
VanshikaSabharwal Mar 13, 2026
438a1ab
testing playwright
VanshikaSabharwal Mar 13, 2026
2b864a6
testing playwright
VanshikaSabharwal Mar 13, 2026
b4bb6aa
testing playwright
VanshikaSabharwal Mar 13, 2026
3c60132
testing playwright
VanshikaSabharwal Mar 13, 2026
bff5683
testing playwright
VanshikaSabharwal Mar 13, 2026
021c004
testing playwright
VanshikaSabharwal Mar 13, 2026
ae95a83
html
VanshikaSabharwal Mar 13, 2026
ce71e8d
html
VanshikaSabharwal Mar 13, 2026
898b456
correct html
VanshikaSabharwal Mar 13, 2026
e2cafa6
Merge branch 'master' into test-2
VanshikaSabharwal Mar 16, 2026
6f0b14e
fixed play-wright for windows and added a new file
VanshikaSabharwal Mar 16, 2026
12ddb3e
commiting to fix back ubunyu and mac
VanshikaSabharwal Mar 16, 2026
1d6b62d
testing by adding bash if windows setup passes
VanshikaSabharwal Mar 16, 2026
4ad70bf
testing by adding bash if windows setup passes
VanshikaSabharwal Mar 16, 2026
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
174 changes: 139 additions & 35 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Integration Test

on:
push:
branches: ["master"]
branches: ["master", "test-2"]
pull_request:
branches: ["master"]
workflow_dispatch:
Expand All @@ -19,64 +19,168 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install MetaCall Unix (Debug)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
- name: Install MetaCall Linux
if: matrix.os == 'ubuntu-latest'
run: curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh -s -- --debug

- name: Set library path for metacall
if: matrix.os == 'macos-latest'
run: |
echo "LIBRARY_PATH=/opt/homebrew/lib" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=/opt/homebrew/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/homebrew/lib" >> $GITHUB_ENV
echo "RUSTFLAGS=-L /opt/homebrew/lib" >> $GITHUB_ENV

- name: Install MetaCall macOS
if: matrix.os == 'macos-latest'
run: curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh -s --

- name: Install MetaCall Windows
if: matrix.os == 'windows-latest'
run: powershell -NoProfile -ExecutionPolicy Unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/metacall/install/master/install.ps1')))"

- name: Debug MetaCall installation
if: matrix.os != 'windows-latest'
run: |
echo "Searching for metacall libraries.."
find /usr -name "libmetacall*" 2>/dev/null || true
find /opt -name "libmetacall*" 2>/dev/null || true
find $HOME -name "libmetacall*" 2>/dev/null || true

echo "Listing /opt/homebrew/lib"
ls -la /opt/homebrew/lib || true

echo "Environment variables:"
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
echo "PATH=$PATH"

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Build
run: cargo build
run: cargo build --verbose

- name: Integration Testing
- name: Fix npm cache permissions (macOS only)
if: matrix.os == 'macos-latest'
run: sudo chown -R $(id -u):$(id -g) ~/.npm

- name: Build Web App
working-directory: ./tests/web-app
shell: bash
env:
npm_config_script_shell: bash
run: |
npm install
npm run build:debug
npm run build:debug > build.log 2>&1 &
BUILD_PID=$!

echo "Watching build logs..."

for i in {1..60}; do
if grep -q "Building is completed" build.log; then
echo "Build completed detected"
kill $BUILD_PID || true
break
fi

if ! kill -0 $BUILD_PID 2>/dev/null; then
echo "Build process exited"
break
fi

sleep 1
done

- name: Install Playwright
working-directory: ./tests/web-app
run: |
npm install playwright
npx playwright install chromium

- name: Start Server
working-directory: ./tests/web-app
shell: bash
run: |
npm run start:debug &
sleep 10
response=$(curl --write-out "%{http_code}" --silent --output /dev/null http://localhost:8080)
if [ "$response" -ne 200 ]; then
echo "Server did not respond with status 200"
exit 1
fi
exit 0

# TODO: Improve testing by checking if resulting HTML is correct

# - name: Install Playwright
# run: npm install -g playwright

# - name: Run Playwright test
# run: |
# node -e "
# const { chromium } = require('playwright');
# (async () => {
# const browser = await chromium.launch();
# const page = await browser.newPage();
# await page.goto('http://localhost:3000');
# const html = await page.content();
# if (!html.includes('<title>My Node App</title>')) {
# console.error('HTML content did not match expected value');
# process.exit(1);
# }
# await browser.close();
# })();
# "
echo $! > server.pid

echo "Waiting for server..."

for i in {1..30}; do
if curl -fs http://localhost:8080 > /dev/null; then
echo "Server ready"
exit 0
fi
sleep 2
done

echo "Server failed to start"
exit 1

- name: Debug server response (Windows)
if: matrix.os == 'windows-latest'
shell: bash
run: |
curl -v http://localhost:8080/ || true

- name: Run Playwright test
working-directory: ./tests/web-app
shell: bash
run: |
node -e "
const { chromium } = require('playwright');

(async () => {
console.log('Launching browser...');
const browser = await chromium.launch();

try {
const page = await browser.newPage();

console.log('Opening...');
const response = await page.goto('http://localhost:8080', {
waitUntil: 'domcontentloaded',
timeout: 30000
});
console.log('Response status:', response ? response.status() : 'none');

const html = await page.content();
console.log('Page loaded. Checking HTML Content...');

if (!html.includes('<title>My website</title>')) {
throw new Error('Missing or incorrect <title>My website</title>');
}

if (!html.includes('<div id=\"root\">')) {
throw new Error('Missing root div');
}

if (!html.includes('/dist/pages/index.js.js')) {
throw new Error('Missing main script');
}

if (!html.includes('/dist/pages/index.js.css')) {
throw new Error('Missing stylesheet');
}

if (!html.includes('lang=\"en\"')) {
throw new Error('HTML lang attribute not set to en');
}

console.log('All HTML checks passed!');
} finally {
await browser.close();
}
})();
"
28 changes: 28 additions & 0 deletions tests/web-app/play-wright-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const { chromium } = require('playwright');

(async () => {
console.log('Launching browser...');
const browser = await chromium.launch();
try {
const page = await browser.newPage();
console.log('Opening...');
await page.goto('http://localhost:8080');
const html = await page.content();
console.log('Page loaded. Checking HTML content...');

if (!html.includes('<title>My website</title>'))
throw new Error('Missing or incorrect <title>My website</title>');
if (!html.includes('<div id="root">'))
throw new Error('Missing root div');
if (!html.includes('/dist/pages/index.js.js'))
throw new Error('Missing main script');
if (!html.includes('/dist/pages/index.js.css'))
throw new Error('Missing stylesheet');
if (!html.includes('lang="en"'))
throw new Error('HTML lang attribute not set to en');

console.log('All HTML checks passed!');
} finally {
await browser.close();
}
})();
Loading