mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-25 04:22:05 +00:00
5de22d8ce6
- Added functionality to track the remote SHA of the agent source, improving consistency during updates. - Implemented a new method to sync the full support-agent source from GitHub, ensuring all necessary files are staged for rebuilds. - Introduced a mechanism to check for agent source drift, allowing for automatic repairs when discrepancies are detected. - Updated the update service to trigger agent source synchronization and rebuilds based on specific file changes, streamlining the update workflow.
34 lines
997 B
JavaScript
34 lines
997 B
JavaScript
'use strict';
|
|
|
|
const test = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
|
|
const updateService = require('../services/updateService');
|
|
|
|
test('shouldQueueAgentRebuild triggers on support-agent source changes', () => {
|
|
const data = {
|
|
grouped: {
|
|
supportAgent: [{ path: 'betterdesk-support-agent/urls.go' }],
|
|
},
|
|
};
|
|
assert.equal(updateService.shouldQueueAgentRebuild(data), true);
|
|
});
|
|
|
|
test('shouldQueueAgentRebuild triggers on build worker-only commits', () => {
|
|
const data = {
|
|
grouped: {
|
|
console: [{ path: 'web-nodejs/services/agentBuildWorker.js' }],
|
|
},
|
|
};
|
|
assert.equal(updateService.shouldQueueAgentRebuild(data), true);
|
|
});
|
|
|
|
test('shouldQueueAgentRebuild ignores unrelated console changes', () => {
|
|
const data = {
|
|
grouped: {
|
|
console: [{ path: 'web-nodejs/views/settings.ejs' }],
|
|
},
|
|
};
|
|
assert.equal(updateService.shouldQueueAgentRebuild(data), false);
|
|
});
|