1
0
forked from baron/baron-sso

CI test 업데이트

This commit is contained in:
Lectom C Han
2026-02-20 09:43:19 +09:00
parent 5d8697e361
commit 8ed3bd8c77
11 changed files with 714 additions and 401 deletions

View File

@@ -146,7 +146,8 @@ jobs:
- name: Upload backend failure report artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
continue-on-error: true
with:
name: backend-test-failure-report
path: |
@@ -168,94 +169,31 @@ jobs:
channel: "stable"
cache: true
- name: Ensure browser for Flutter web tests
run: |
has_runnable_browser=false
for candidate in google-chrome google-chrome-stable chromium chromium-browser; do
if command -v "$candidate" >/dev/null 2>&1 && "$candidate" --version >/dev/null 2>&1; then
has_runnable_browser=true
break
fi
done
if [ "$has_runnable_browser" = true ]; then
echo "Runnable Chrome/Chromium already installed."
exit 0
fi
if command -v sudo >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y chromium || sudo apt-get install -y chromium-browser
else
apt-get update
apt-get install -y chromium || apt-get install -y chromium-browser
fi
for candidate in google-chrome google-chrome-stable chromium chromium-browser; do
if command -v "$candidate" >/dev/null 2>&1 && "$candidate" --version >/dev/null 2>&1; then
echo "Installed browser: $candidate"
exit 0
fi
done
echo "No runnable Chrome/Chromium found after install."
exit 1
- name: Run userfront tests
run: |
cd userfront
if [ -d test ]; then
CHROME_BIN=""
for candidate in google-chrome google-chrome-stable chromium chromium-browser; do
if command -v "$candidate" >/dev/null 2>&1 && "$candidate" --version >/dev/null 2>&1; then
CHROME_BIN="$(command -v "$candidate")"
break
fi
done
if [ -z "$CHROME_BIN" ]; then
echo "Chrome/Chromium not found for web tests."
exit 1
fi
echo "Using browser: $CHROME_BIN"
export CHROME_EXECUTABLE="$CHROME_BIN"
mkdir -p ../reports
set +e
flutter test 2>&1 | tee ../reports/userfront-test-vm.log
vm_test_exit_code=${PIPESTATUS[0]}
web_test_exit_code=0
if [ "$vm_test_exit_code" -eq 0 ]; then
flutter test --platform chrome test/locale_storage_platform_test.dart 2>&1 | tee ../reports/userfront-test-web.log
web_test_exit_code=${PIPESTATUS[0]}
fi
flutter test 2>&1 | tee ../reports/userfront-test.log
test_exit_code=${PIPESTATUS[0]}
set -e
if [ "$vm_test_exit_code" -ne 0 ] || [ "$web_test_exit_code" -ne 0 ]; then
if [ "$test_exit_code" -ne 0 ]; then
{
echo "# Userfront Test Failure Report"
echo
echo "- Workflow: \`${GITHUB_WORKFLOW:-Code Check}\`"
echo "- Job: \`userfront-tests\`"
echo "- Browser: \`$CHROME_BIN\`"
echo "- VM Test Exit Code: \`$vm_test_exit_code\`"
echo "- Web Test Exit Code: \`$web_test_exit_code\`"
echo "- Exit Code: \`$test_exit_code\`"
echo
echo "## Commands"
echo "1. \`flutter test\`"
echo "2. \`flutter test --platform chrome test/locale_storage_platform_test.dart\`"
echo "## Command"
echo "\`flutter test\`"
echo
if [ -f ../reports/userfront-test-vm.log ]; then
echo "## VM Test Log Tail (last 200 lines)"
if [ -f ../reports/userfront-test.log ]; then
echo "## Test Log Tail (last 200 lines)"
echo '```text'
tail -n 200 ../reports/userfront-test-vm.log
echo '```'
echo
fi
if [ -f ../reports/userfront-test-web.log ]; then
echo "## Web Test Log Tail (last 200 lines)"
echo '```text'
tail -n 200 ../reports/userfront-test-web.log
tail -n 200 ../reports/userfront-test.log
echo '```'
fi
} > ../reports/userfront-test-failure-report.md
@@ -265,6 +203,29 @@ jobs:
echo "No userfront tests: skipping (test/ directory not found)."
fi
- name: Ensure userfront failure report exists
if: ${{ failure() }}
run: |
mkdir -p reports
if [ -f reports/userfront-test-failure-report.md ]; then
exit 0
fi
{
echo "# Userfront Test Failure Report"
echo
echo "- Workflow: \`${GITHUB_WORKFLOW:-Code Check}\`"
echo "- Job: \`userfront-tests\`"
echo "- Reason: \`Job failed before detailed report generation\`"
echo
if [ -f reports/userfront-test.log ]; then
echo "## Test Log Tail (last 200 lines)"
echo '```text'
tail -n 200 reports/userfront-test.log
echo '```'
fi
} > reports/userfront-test-failure-report.md
- name: Publish userfront failure summary
if: ${{ failure() }}
run: |
@@ -274,13 +235,13 @@ jobs:
- name: Upload userfront failure report artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
continue-on-error: true
with:
name: userfront-test-failure-report
path: |
reports/userfront-test-failure-report.md
reports/userfront-test-vm.log
reports/userfront-test-web.log
reports/userfront-test.log
if-no-files-found: ignore
adminfront-tests:
@@ -300,13 +261,62 @@ jobs:
- name: Install adminfront dependencies
run: |
mkdir -p reports
set +e
cd adminfront
npm ci
npm ci 2>&1 | tee ../reports/adminfront-install.log
install_exit_code=${PIPESTATUS[0]}
cd ..
set -e
if [ "$install_exit_code" -ne 0 ]; then
{
echo "# Adminfront Test Failure Report"
echo
echo "- Workflow: \`${GITHUB_WORKFLOW:-Code Check}\`"
echo "- Job: \`adminfront-tests\`"
echo "- Reason: \`Dependency install failed\`"
echo "- Exit Code: \`$install_exit_code\`"
echo
echo "## Command"
echo "\`cd adminfront && npm ci\`"
echo
echo "## Install Log Tail (last 200 lines)"
echo '```text'
tail -n 200 reports/adminfront-install.log
echo '```'
} > reports/adminfront-test-failure-report.md
exit 1
fi
- name: Provision browsers for adminfront tests
run: |
set +e
cd adminfront
npx playwright install --with-deps
npx playwright install --with-deps 2>&1 | tee ../reports/adminfront-provision.log
provision_exit_code=${PIPESTATUS[0]}
cd ..
set -e
if [ "$provision_exit_code" -ne 0 ]; then
{
echo "# Adminfront Test Failure Report"
echo
echo "- Workflow: \`${GITHUB_WORKFLOW:-Code Check}\`"
echo "- Job: \`adminfront-tests\`"
echo "- Reason: \`Browser provisioning failed\`"
echo "- Exit Code: \`$provision_exit_code\`"
echo
echo "## Command"
echo "\`cd adminfront && npx playwright install --with-deps\`"
echo
echo "## Provision Log Tail (last 200 lines)"
echo '```text'
tail -n 200 reports/adminfront-provision.log
echo '```'
} > reports/adminfront-test-failure-report.md
exit 1
fi
- name: Run adminfront tests
run: |
@@ -341,6 +351,43 @@ jobs:
exit "$test_exit_code"
- name: Ensure adminfront failure report exists
if: ${{ failure() }}
run: |
mkdir -p reports
if [ -f reports/adminfront-test-failure-report.md ]; then
exit 0
fi
{
echo "# Adminfront Test Failure Report"
echo
echo "- Workflow: \`${GITHUB_WORKFLOW:-Code Check}\`"
echo "- Job: \`adminfront-tests\`"
echo "- Reason: \`Job failed before detailed report generation\`"
echo
if [ -f reports/adminfront-install.log ]; then
echo "## Install Log Tail (last 200 lines)"
echo '```text'
tail -n 200 reports/adminfront-install.log
echo '```'
echo
fi
if [ -f reports/adminfront-provision.log ]; then
echo "## Provision Log Tail (last 200 lines)"
echo '```text'
tail -n 200 reports/adminfront-provision.log
echo '```'
echo
fi
if [ -f reports/adminfront-test.log ]; then
echo "## Test Log Tail (last 200 lines)"
echo '```text'
tail -n 200 reports/adminfront-test.log
echo '```'
fi
} > reports/adminfront-test-failure-report.md
- name: Publish adminfront failure summary
if: ${{ failure() }}
run: |
@@ -350,11 +397,14 @@ jobs:
- name: Upload adminfront failure report artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
continue-on-error: true
with:
name: adminfront-test-failure-report
path: |
reports/adminfront-test-failure-report.md
reports/adminfront-install.log
reports/adminfront-provision.log
reports/adminfront-test.log
adminfront/playwright-report
adminfront/test-results
@@ -377,13 +427,62 @@ jobs:
- name: Install devfront dependencies
run: |
mkdir -p reports
set +e
cd devfront
npm ci
npm ci 2>&1 | tee ../reports/devfront-install.log
install_exit_code=${PIPESTATUS[0]}
cd ..
set -e
if [ "$install_exit_code" -ne 0 ]; then
{
echo "# Devfront Test Failure Report"
echo
echo "- Workflow: \`${GITHUB_WORKFLOW:-Code Check}\`"
echo "- Job: \`devfront-tests\`"
echo "- Reason: \`Dependency install failed\`"
echo "- Exit Code: \`$install_exit_code\`"
echo
echo "## Command"
echo "\`cd devfront && npm ci\`"
echo
echo "## Install Log Tail (last 200 lines)"
echo '```text'
tail -n 200 reports/devfront-install.log
echo '```'
} > reports/devfront-test-failure-report.md
exit 1
fi
- name: Provision browsers for devfront tests
run: |
set +e
cd devfront
npx playwright install --with-deps
npx playwright install --with-deps 2>&1 | tee ../reports/devfront-provision.log
provision_exit_code=${PIPESTATUS[0]}
cd ..
set -e
if [ "$provision_exit_code" -ne 0 ]; then
{
echo "# Devfront Test Failure Report"
echo
echo "- Workflow: \`${GITHUB_WORKFLOW:-Code Check}\`"
echo "- Job: \`devfront-tests\`"
echo "- Reason: \`Browser provisioning failed\`"
echo "- Exit Code: \`$provision_exit_code\`"
echo
echo "## Command"
echo "\`cd devfront && npx playwright install --with-deps\`"
echo
echo "## Provision Log Tail (last 200 lines)"
echo '```text'
tail -n 200 reports/devfront-provision.log
echo '```'
} > reports/devfront-test-failure-report.md
exit 1
fi
- name: Run devfront tests
run: |
@@ -418,6 +517,43 @@ jobs:
exit "$test_exit_code"
- name: Ensure devfront failure report exists
if: ${{ failure() }}
run: |
mkdir -p reports
if [ -f reports/devfront-test-failure-report.md ]; then
exit 0
fi
{
echo "# Devfront Test Failure Report"
echo
echo "- Workflow: \`${GITHUB_WORKFLOW:-Code Check}\`"
echo "- Job: \`devfront-tests\`"
echo "- Reason: \`Job failed before detailed report generation\`"
echo
if [ -f reports/devfront-install.log ]; then
echo "## Install Log Tail (last 200 lines)"
echo '```text'
tail -n 200 reports/devfront-install.log
echo '```'
echo
fi
if [ -f reports/devfront-provision.log ]; then
echo "## Provision Log Tail (last 200 lines)"
echo '```text'
tail -n 200 reports/devfront-provision.log
echo '```'
echo
fi
if [ -f reports/devfront-test.log ]; then
echo "## Test Log Tail (last 200 lines)"
echo '```text'
tail -n 200 reports/devfront-test.log
echo '```'
fi
} > reports/devfront-test-failure-report.md
- name: Publish devfront failure summary
if: ${{ failure() }}
run: |
@@ -427,11 +563,14 @@ jobs:
- name: Upload devfront failure report artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
continue-on-error: true
with:
name: devfront-test-failure-report
path: |
reports/devfront-test-failure-report.md
reports/devfront-install.log
reports/devfront-provision.log
reports/devfront-test.log
devfront/playwright-report
devfront/test-results