keyless-smoke.e2e.ts 1.2 KB

12345678910111213141516171819202122232425262728
  1. import { fileURLToPath } from 'node:url'
  2. import { describe, expect, it } from 'vitest'
  3. import { LOADER_SMOKE_TEST_TIMEOUT_MS, runLoaderSmoke } from '@deepseek-ai/dsh-loader-smoke'
  4. /**
  5. * Keyless Loader-path smoke for examples/coding-agent: boot the real example
  6. * through the stdio-agent bin and its `cordis.yml`, then close stdin without a
  7. * prompt and assert the banner. The dummy key satisfies adapter construction;
  8. * immediate EOF guarantees there is no model call.
  9. */
  10. const binScript = fileURLToPath(new URL('../../../packages/examples/stdio-demo/src/bin.ts', import.meta.url))
  11. const configPath = fileURLToPath(new URL('../cordis.yml', import.meta.url))
  12. const tsconfigPath = fileURLToPath(new URL('../../../tsconfig.json', import.meta.url))
  13. describe('coding-agent keyless smoke (real cordis.yml via the Loader)', () => {
  14. it('boots the full plugin tree, prints its banner, and exits cleanly on EOF', async () => {
  15. const { stdout } = await runLoaderSmoke({
  16. label: 'coding-agent',
  17. tempDirPrefix: 'coding-smoke-',
  18. binScript,
  19. configPath,
  20. tsconfigPath,
  21. env: { DEEPSEEK_API_KEY: 'keyless-smoke-no-call' },
  22. })
  23. expect(stdout).toContain('agent REPL ready.')
  24. }, LOADER_SMOKE_TEST_TIMEOUT_MS)
  25. })