mirror of
https://github.com/whyour/qinglong.git
synced 2026-12-01 09:45:36 +08:00
feat(cron): expose run receipts and modularize execution
Return committed trigger IDs and add CLI wait and trigger-specific logs while preserving API, CLI, transaction, deduplication and unknown-result semantics. Move scheduling, lifecycle, settlement, queries and legacy adapters into back/cron; remove obsolete internal import paths and circular dependencies. Apply project formatting across the repository, cover CJS/MJS in formatting hooks, add prettier:check and require formatting checks in AGENTS.md. Validation: backend build; 1398 backend/frontend tests passed (17 platform skips); 327 CLI tests passed (6 platform skips); 670 files pass format checks.
This commit is contained in:
1 parent
77ece406ac
commit
c5458596c8
346 files changed
+32133
-11556
No files matched your search
@@ -5,24 +5,35 @@ const { runProcess } = require('../../dist/internal/runtime/process');
|
||||
|
||||
test('environment transport preserves multiline values, empty values and exported functions', async () => {
|
||||
const value = '中文\nsecond=line\r\n"quoted"\\literal';
|
||||
const env = await sourceEnvironment({ PATH: process.env.PATH, VALUE: value }, [], [], {
|
||||
command: 'export EMPTY=""; exported_fn() { printf "%s" "$VALUE"; }; export -f exported_fn; set -o pipefail; shopt -s nullglob; printf "user output"',
|
||||
output: () => {},
|
||||
});
|
||||
const env = await sourceEnvironment(
|
||||
{ PATH: process.env.PATH, VALUE: value },
|
||||
[],
|
||||
[],
|
||||
{
|
||||
command:
|
||||
'export EMPTY=""; exported_fn() { printf "%s" "$VALUE"; }; export -f exported_fn; set -o pipefail; shopt -s nullglob; printf "user output"',
|
||||
output: () => {},
|
||||
},
|
||||
);
|
||||
assert.equal(env.VALUE, value);
|
||||
assert.equal(env.EMPTY, '');
|
||||
assert.ok(env.QL_CLI_SHELLOPTS.split(':').includes('pipefail'));
|
||||
assert.ok(!env.QL_CLI_SHELLOPTS.split(':').includes('allexport'));
|
||||
assert.ok(env.QL_CLI_BASHOPTS.split(':').includes('nullglob'));
|
||||
assert.ok(!Object.keys(env).some(key => key.startsWith('__ql_')));
|
||||
const child = await runProcess('bash', ['--noprofile', '--norc', '-c', 'exported_fn'], { env, capture: true });
|
||||
assert.ok(!Object.keys(env).some((key) => key.startsWith('__ql_')));
|
||||
const child = await runProcess(
|
||||
'bash',
|
||||
['--noprofile', '--norc', '-c', 'exported_fn'],
|
||||
{ env, capture: true },
|
||||
);
|
||||
assert.equal(child.code, 0);
|
||||
assert.equal(child.stdout, value);
|
||||
});
|
||||
|
||||
test('environment transport does not execute a Node runtime from user configuration', async () => {
|
||||
const env = await sourceEnvironment({ PATH: process.env.PATH }, [], [], {
|
||||
command: 'export NODE_OPTIONS="--this-option-does-not-exist"; export PATH="/nonexistent"',
|
||||
command:
|
||||
'export NODE_OPTIONS="--this-option-does-not-exist"; export PATH="/nonexistent"',
|
||||
});
|
||||
assert.equal(env.NODE_OPTIONS, '--this-option-does-not-exist');
|
||||
assert.equal(env.PATH, '/nonexistent');
|
||||
|
||||
Reference in new issue
Block a user