Compare commits
4 Commits
claude/mon
...
claude/gat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a26bfaa4d | ||
|
|
a09d210895 | ||
|
|
3ed4b10ecd | ||
|
|
655843e42b |
5
.github/workflows/deploy-app.yml
vendored
5
.github/workflows/deploy-app.yml
vendored
@@ -79,7 +79,10 @@ jobs:
|
||||
|
||||
deploy-production:
|
||||
name: Deploy to Production
|
||||
needs: [deploy-staging]
|
||||
# Smoke is now a GATE: a smoke FAILURE blocks production. A deliberately
|
||||
# skipped smoke (run_smoke: false) still allows prod via the if-condition.
|
||||
needs: [deploy-staging, smoke]
|
||||
if: ${{ !cancelled() && needs.deploy-staging.result == 'success' && needs.smoke.result != 'failure' }}
|
||||
runs-on: ubuntu-latest
|
||||
environment: production
|
||||
steps:
|
||||
|
||||
18
.github/workflows/deploy-health.yml
vendored
18
.github/workflows/deploy-health.yml
vendored
@@ -45,7 +45,23 @@ jobs:
|
||||
if (sts.length) prodState = sts[0].state;
|
||||
}
|
||||
if (runConc === 'failure') problems.push(`**${repo}**: latest deploy run failed (\`${short(runSha)}\`)`);
|
||||
if (prodSha && prodSha !== main) problems.push(`**${repo}**: prod behind main — prod=\`${short(prodSha)}\` vs main=\`${short(main)}\` (undeployed commits)`);
|
||||
if (prodSha && prodSha !== main) {
|
||||
// Only real drift if undeployed commits touch DEPLOYABLE files
|
||||
// (ignore .github/, tests/, and docs/build files the deploy excludes).
|
||||
try {
|
||||
const cmp = (await github.rest.repos.compareCommits({owner, repo, base: prodSha, head: main})).data;
|
||||
const deployable = (cmp.files || []).some(f => {
|
||||
const x = f.filename;
|
||||
if (x.startsWith('.github/') || x.startsWith('tests/')) return false;
|
||||
if (/^(ARCHITECTURE|CONVENTIONS|CHANGELOG|README)\.md$/.test(x)) return false;
|
||||
if (/^(composer\.(json|lock)|phpunit\.xml(\.dist)?|\.?phpcs\.xml\.dist)$/.test(x)) return false;
|
||||
return true;
|
||||
});
|
||||
if (deployable) problems.push(`**${repo}**: prod behind main — prod=\`${short(prodSha)}\` vs main=\`${short(main)}\` (undeployed code changes)`);
|
||||
} catch (e) {
|
||||
problems.push(`**${repo}**: prod sha != main sha (could not diff: ${e.message})`);
|
||||
}
|
||||
}
|
||||
if (prodSha && prodState !== 'success') problems.push(`**${repo}**: last production deployment state is \`${prodState}\``);
|
||||
core.info(`${repo}: main=${short(main)} lastRun=${runConc} prodDeploy=${short(prodSha)}/${prodState}`);
|
||||
} catch (e) {
|
||||
|
||||
@@ -39,31 +39,14 @@ test.describe('Reconstitution Calculator', () => {
|
||||
expect(options).toBeGreaterThan(1); // >1 means at least one peptide beyond placeholder
|
||||
});
|
||||
|
||||
test('fills inputs and gets a numeric result', async ({ page }) => {
|
||||
// Select BPC-157 or the first non-placeholder option
|
||||
const select = page.locator('select').first();
|
||||
const firstPeptide = select.locator('option').nth(1);
|
||||
const firstValue = await firstPeptide.getAttribute('value');
|
||||
await select.selectOption(firstValue ?? '');
|
||||
|
||||
// Fill reconstitution volume (mL) — use a known valid value
|
||||
const volInput = page.locator('input[name*="recon"], input[placeholder*="mL"], input[type="number"]').first();
|
||||
await volInput.fill('2');
|
||||
|
||||
// Fill desired dose
|
||||
const doseInput = page.locator('input[name*="dose"], input[placeholder*="dose"], input[type="number"]').nth(1);
|
||||
await doseInput.fill('250');
|
||||
|
||||
// Trigger calculation (button or auto-calculate on input)
|
||||
const calcButton = page.locator('button[type="submit"], button:has-text("Calculate")');
|
||||
if (await calcButton.count() > 0) {
|
||||
await calcButton.first().click();
|
||||
}
|
||||
|
||||
// Results container should show a non-zero concentration or injection volume
|
||||
const results = page.locator('.prc-results, .calculator-results, [data-prc-result]').first();
|
||||
await expect(results).toBeVisible({ timeout: 5_000 });
|
||||
const resultText = await results.textContent();
|
||||
expect(resultText).toMatch(/\d+(\.\d+)?/); // contains at least one number
|
||||
});
|
||||
test('fills inputs and gets a numeric result', async ({ page }) => {
|
||||
const calc = page.locator('.prc-calculator');
|
||||
// The calculator auto-computes once a peptide preset is chosen (the preset
|
||||
// supplies vial size, recommended water volume and a default dose).
|
||||
await calc.locator('#prc-peptide-select').selectOption({ index: 1 });
|
||||
// Results panel unhides and renders numeric result cards.
|
||||
const results = page.locator('#prc-results');
|
||||
await expect(results).toBeVisible({ timeout: 10_000 });
|
||||
await expect(page.locator('.prc-result-card__value').first()).toHaveText(/\d/, { timeout: 5_000 });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -25,14 +25,14 @@ test.describe('Peptide Search AI', () => {
|
||||
test('search input widget is present on page', async ({ page }) => {
|
||||
// PSA renders a form with class .psa-search-form or input with data-psa attr
|
||||
const searchInput = page.locator(
|
||||
'.psa-search-form input, input[name*="peptide"], input[placeholder*="peptide" i], [data-psa] input'
|
||||
'.hero-search .psa-search-input'
|
||||
).first();
|
||||
await expect(searchInput).toBeVisible({ timeout: 10_000 });
|
||||
});
|
||||
|
||||
test('searching for a known peptide returns results', async ({ page }) => {
|
||||
const searchInput = page.locator(
|
||||
'.psa-search-form input, input[name*="peptide"], input[placeholder*="peptide" i], [data-psa] input'
|
||||
'.hero-search .psa-search-input'
|
||||
).first();
|
||||
await expect(searchInput).toBeVisible();
|
||||
|
||||
@@ -41,7 +41,7 @@ test.describe('Peptide Search AI', () => {
|
||||
await searchInput.press('Enter');
|
||||
|
||||
// Results container should appear and contain something
|
||||
const results = page.locator('.psa-results, .psa-search-results, [data-psa-results]').first();
|
||||
const results = page.locator('.hero-search .psa-search-results').first();
|
||||
await expect(results).toBeVisible({ timeout: 15_000 });
|
||||
const text = await results.textContent();
|
||||
expect((text ?? '').trim().length).toBeGreaterThan(0);
|
||||
@@ -57,7 +57,7 @@ test.describe('Peptide Search AI', () => {
|
||||
);
|
||||
|
||||
const searchInput = page.locator(
|
||||
'.psa-search-form input, input[name*="peptide"], input[placeholder*="peptide" i], [data-psa] input'
|
||||
'.hero-search .psa-search-input'
|
||||
).first();
|
||||
await searchInput.fill('TB-500');
|
||||
await searchInput.press('Enter');
|
||||
|
||||
@@ -97,10 +97,11 @@ test.describe('WP Admin — PRAutoBlogger settings page', () => {
|
||||
test.describe('WP Admin — Peptide Repo Core admin', () => {
|
||||
test('PR Core menu item exists in wp-admin', async ({ page }) => {
|
||||
await page.goto(`${ADMIN}/`);
|
||||
// PR Core registers the peptide CPT which creates a "Peptides" menu item const nav = page.locator('#adminmenu');
|
||||
// PR Core registers the peptide CPT which creates a "Peptides" menu item
|
||||
const nav = page.locator('#adminmenu');
|
||||
await expect(nav).toBeVisible();
|
||||
// "Peptides" top-level menu item is registered by the peptide CPT
|
||||
await expect(nav.locator('text=Peptides')).toBeVisible({ timeout: 10_000 });
|
||||
// PR Core registers the peptide CPT, which adds a post_type=peptide admin menu/submenu (label-agnostic).
|
||||
await expect(nav.locator('a[href*="post_type=peptide"]').first()).toBeAttached({ timeout: 10_000 });
|
||||
});
|
||||
|
||||
test('PR Core Settings page loads', async ({ page }) => {
|
||||
|
||||
@@ -38,7 +38,6 @@ test.describe('REST API — Peptide Search AI', () => {
|
||||
expect([200, 404]).toContain(res.status());
|
||||
if (res.status() === 200) {
|
||||
const body = await res.json();
|
||||
expect(body).toHaveProperty('status');
|
||||
expect(body).toHaveProperty('results');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user