Files
ss-tools/frontend/e2e/tests/git.e2e.js
busya f49b7d909e feat: GRACE-Poly protocol optimization — ~3200→10 warnings (↓99.7%)
Full optimization cycle:

Protocol (15 files):
- 4-layer SSOT architecture for agent prompts & skills
- Anti-Corruption Protocol consolidated from 5 duplicates
- Tag-to-tier permissiveness matrix (all @tags allowed at all tiers)

Axiom config:
- complexity_rules: all 22+ tags available on C1-C5
- contract_type_overrides: removed (was narrowing per-type)
- 18 new tags added, LAYER enum expanded (Infra, Frontend, Atom, etc.)
- RELATION predicates expanded (USES, CONTAINS, BELONGS_TO, etc.)

Code fixes:
- 2216 @TAG: normalized to @TAG (colon→space)
- 518 [DEF] blocks migrated to #region/#endregion (37 files)
- VERIFIES→BINDS_TO, :Class/:Function suffixes removed, paths→IDs
- 1173-line _external_stubs.py deleted (EXT: handled natively)
- Batch EXT: reference audit (240 targets: 132 external, 99 internal, 9 fix)
- QA regression check: 0 regressions across all checks

Infrastructure:
- DuckDB rebuild stabilized (appender API, INSERT OR IGNORE)
- Anchor regex fix (parent-child BINDS_TO now resolves)
- EXT:*/DTO:/NEED_CONTEXT: regex fixed in validator
- 34MB Doxygen API portal (3194 contract pages)
2026-05-26 11:14:25 +03:00

91 lines
3.2 KiB
JavaScript

// #region GitE2E [C:3] [TYPE Test] [SEMANTICS e2e, git, integration, config]
// @BRIEF E2E tests for Git integration — config CRUD, connection test.
// @RELATION BINDS_TO -> [GitSettingsPage]
// @UX_STATE ConfigCreated -> Git server appears in configured list.
// @UX_STATE ConnectionTested -> Success/failure toast feedback.
import { test, expect } from '../fixtures/auth.fixture.js';
import { apiGet, apiPost, apiDelete } from '../helpers/api.helper.js';
const FRONTEND_URL = process.env.FRONTEND_URL || 'http://127.0.0.1:8102';
const GITEA_URL = process.env.GITEA_URL || 'https://git.bebesh.ru';
const GITEA_TOKEN = process.env.GITEA_TOKEN || 'd5e3a0bea62121dcafbf33070e85d65e8a383c20';
test.describe('Git Integration', () => {
test('should have git config visible in settings UI', async ({ authPage }) => {
await authPage.goto(`${FRONTEND_URL}/settings#/settings/git`);
await authPage.waitForSelector('text=Интеграция Git', { timeout: 10_000 });
// Configured servers section visible
await expect(authPage.getByText(/Настроенные серверы/)).toBeVisible();
// Add git server form visible
await expect(authPage.getByText(/Добавить Git-сервер|Add Git server/)).toBeVisible();
});
test('should create git config via API and verify in UI', async ({ authPage }) => {
const configName = `E2E-Gitea-${Date.now()}`;
// Create via API
const config = await apiPost('/api/git/config', {
name: configName,
provider: 'GITEA',
url: GITEA_URL,
pat: GITEA_TOKEN,
default_repository: 'busya/ss-tools',
default_branch: 'main',
});
expect(config).toBeDefined();
expect(config.id).toBeTruthy();
expect(config.provider).toBe('GITEA');
// Verify in UI
await authPage.goto(`${FRONTEND_URL}/settings#/settings/git`);
await authPage.waitForSelector('text=Интеграция Git', { timeout: 10_000 });
await expect(authPage.getByText(configName).first()).toBeVisible({ timeout: 10_000 });
// Cleanup
await apiDelete(`/api/git/config/${config.id}`);
});
test('should test git connection successfully', async ({ authPage }) => {
// Get existing configs
const configs = await apiGet('/api/git/config');
if (configs.length === 0) {
console.log('[E2E] No git configs to test, skipping');
return;
}
const config = configs[0];
const result = await apiPost('/api/git/config/test', {
name: config.name,
provider: config.provider,
url: config.url,
pat: GITEA_TOKEN,
config_id: config.id,
});
expect(result.status).toBe('success');
});
test('should list Gitea repositories', async ({ authPage }) => {
const configs = await apiGet('/api/git/config');
if (configs.length === 0) {
console.log('[E2E] No git configs to list repos, skipping');
return;
}
const config = configs[0];
if (config.provider !== 'GITEA') {
console.log('[E2E] Provider is not GITEA, skipping');
return;
}
const repos = await apiGet(`/api/git/config/${config.id}/gitea/repos`);
expect(Array.isArray(repos)).toBeTruthy();
expect(repos.length).toBeGreaterThan(0);
// Should include the ss-tools repo
const hasSsTools = repos.some(r => r.full_name?.includes('ss-tools'));
expect(hasSsTools).toBeTruthy();
});
});
// #endregion GitE2E