Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz Source: /opt/alga-psa on psa.joliet.tech
40 lines
1.7 KiB
JavaScript
40 lines
1.7 KiB
JavaScript
import fs from 'node:fs';
|
|
import os from 'node:os';
|
|
import path from 'node:path';
|
|
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { persistMaintenanceMetadata } from '../metadata-engine.mjs';
|
|
|
|
test('persistMaintenanceMetadata writes v1 manual update posture and app metadata', () => {
|
|
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'alga-maint-meta-'));
|
|
const metadataFile = path.join(tmp, 'maintenance-metadata.json');
|
|
const releaseSelectionFile = path.join(tmp, 'release-selection.json');
|
|
const installStateFile = path.join(tmp, 'install-state.json');
|
|
const osReleaseFile = path.join(tmp, 'os-release');
|
|
|
|
fs.writeFileSync(releaseSelectionFile, JSON.stringify({
|
|
selectedChannel: 'stable',
|
|
selectedReleaseVersion: '1.2.3',
|
|
registryHost: 'ghcr.io',
|
|
repository: 'nine-minds/alga-appliance-release',
|
|
manifestDigest: 'sha256:release'
|
|
}));
|
|
fs.writeFileSync(installStateFile, JSON.stringify({ status: 'update-complete', phase: 'registry-release-source' }));
|
|
fs.writeFileSync(osReleaseFile, 'ID=ubuntu\nVERSION_ID="24.04"\nPRETTY_NAME="Ubuntu 24.04 LTS"\n');
|
|
|
|
const result = persistMaintenanceMetadata({
|
|
metadataFile,
|
|
releaseSelectionFile,
|
|
installStateFile,
|
|
osReleaseFile,
|
|
k3sVersionCommand: "printf 'k3s version v1.31.4+k3s1'"
|
|
});
|
|
|
|
assert.equal(result.ok, true);
|
|
const persisted = JSON.parse(fs.readFileSync(metadataFile, 'utf8'));
|
|
assert.equal(persisted.host.updatePolicy, 'manual-support-run-v1');
|
|
assert.equal(persisted.k3s.updatePolicy, 'manual-support-run-v1');
|
|
assert.equal(persisted.app.selectedReleaseVersion, '1.2.3');
|
|
assert.equal(typeof persisted.app.lastAppUpdateAt, 'string');
|
|
});
|