badgr-cli 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/LICENSE +207 -0
  2. package/README.md +135 -3
  3. package/package.json +44 -2
  4. package/src/api.js +16 -0
  5. package/src/badgr.js +2 -2
  6. package/src/commands/batch.js +11 -0
  7. package/src/commands/comfyui.js +31 -15
  8. package/src/commands/embed.js +13 -10
  9. package/src/commands/launch.js +8 -1
  10. package/src/commands/login.js +75 -20
  11. package/src/commands/run.js +45 -13
  12. package/src/commands/sbatch.js +6 -1
  13. package/src/commands/serve.js +44 -30
  14. package/src/commands/train.js +8 -12
  15. package/src/commands/transcribe.js +13 -10
  16. package/src/envFlag.js +10 -0
  17. package/src/onboarding.js +8 -1
  18. package/src/progress.js +48 -0
  19. package/tests/agent-images.test.js +0 -17
  20. package/tests/api.test.js +0 -168
  21. package/tests/artifactDownload.test.js +0 -113
  22. package/tests/artifacts.test.js +0 -168
  23. package/tests/batch.test.js +0 -641
  24. package/tests/browser.test.js +0 -51
  25. package/tests/capacity.test.js +0 -68
  26. package/tests/commands.test.js +0 -417
  27. package/tests/config.test.js +0 -96
  28. package/tests/connect.test.js +0 -83
  29. package/tests/detect.test.js +0 -191
  30. package/tests/down.test.js +0 -150
  31. package/tests/errors.test.js +0 -130
  32. package/tests/fallback-timeout.test.js +0 -41
  33. package/tests/fanout.test.js +0 -124
  34. package/tests/gpu-doctor-classifiers.test.js +0 -402
  35. package/tests/gpu-doctor-doctor.test.js +0 -304
  36. package/tests/gpu-doctor-probe-cache.test.js +0 -110
  37. package/tests/gpu-doctor-probes.test.js +0 -257
  38. package/tests/heartbeat.test.js +0 -70
  39. package/tests/job-progress-poll.test.js +0 -136
  40. package/tests/launch-command-argv.test.js +0 -93
  41. package/tests/launch-readiness.test.js +0 -403
  42. package/tests/launch.test.js +0 -440
  43. package/tests/onboarding.test.js +0 -134
  44. package/tests/productized-dry-run.test.js +0 -141
  45. package/tests/productized-runners.test.js +0 -237
  46. package/tests/pull.test.js +0 -266
  47. package/tests/rerun.test.js +0 -94
  48. package/tests/restart.test.js +0 -88
  49. package/tests/router.test.js +0 -98
  50. package/tests/run-lifecycle.test.js +0 -1054
  51. package/tests/sbatch.test.js +0 -190
  52. package/tests/secrets.test.js +0 -16
  53. package/tests/serve-apps.test.js +0 -189
  54. package/tests/serve-lifecycle.test.js +0 -931
  55. package/tests/slurm.test.js +0 -77
  56. package/tests/spec.test.js +0 -201
  57. package/tests/status.test.js +0 -73
  58. package/tests/store.test.js +0 -187
  59. package/tests/task.test.js +0 -109
  60. package/tests/template.test.js +0 -556
  61. package/tests/train-lora-dataset.test.js +0 -176
  62. package/tests/upload.test.js +0 -79
  63. package/tests/workload-rerun.test.js +0 -56
  64. package/tests/workload-spec.test.js +0 -180
  65. package/tests/workload-templates.test.js +0 -865
  66. package/tests/workload-workspace-paths.test.js +0 -46
@@ -1,46 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from 'vitest';
2
-
3
- // Capture every path passed to callApi so we can assert the CLI never builds a
4
- // doubled `/v1/v1/...` URL. baseUrl already ends in `/v1`, so command paths must
5
- // be unprefixed (e.g. `/workspaces`, not `/v1/workspaces`).
6
- const calls = [];
7
- vi.mock('../src/api.js', () => ({
8
- callApi: vi.fn(async (path) => {
9
- calls.push(path);
10
- if (path.startsWith('/workspaces')) return { workspaces: [], total: 0 };
11
- if (path.startsWith('/workloads')) return { workloads: [], total: 0 };
12
- return {};
13
- }),
14
- }));
15
-
16
- const { workspaceCommand } = await import('../src/commands/workspace.js');
17
- const { workloadCommand } = await import('../src/commands/workload.js');
18
-
19
- // chalk stub: any style method returns its first argument unchanged.
20
- const chalk = new Proxy({}, { get: () => (s) => s });
21
- const config = { apiKey: 'test-key', baseUrl: 'https://aibadgr.com/v1' };
22
-
23
- function assertNoDoubleV1() {
24
- expect(calls.length).toBeGreaterThan(0);
25
- for (const path of calls) {
26
- expect(path.startsWith('/v1/')).toBe(false);
27
- expect(`${config.baseUrl}${path}`).not.toContain('/v1/v1/');
28
- }
29
- }
30
-
31
- beforeEach(() => {
32
- calls.length = 0;
33
- vi.spyOn(console, 'log').mockImplementation(() => {});
34
- });
35
-
36
- describe('CLI workload/workspace request paths', () => {
37
- it('workspace list targets /workspaces (no doubled /v1)', async () => {
38
- await workspaceCommand(config, ['list'], chalk);
39
- assertNoDoubleV1();
40
- });
41
-
42
- it('workload list targets /workloads (no doubled /v1)', async () => {
43
- await workloadCommand(config, ['list'], chalk);
44
- assertNoDoubleV1();
45
- });
46
- });