Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a34d74bea
|
||
|
|
324830218c | ||
|
|
5499a86936 | ||
|
|
823adf3c2a
|
||
|
|
2593993622 | ||
|
|
2eb7aad21f
|
||
|
|
a00cc64edc
|
||
|
|
ca65cba959
|
No files matched your search
@@ -1,8 +0,0 @@
|
||||
version: 2.1
|
||||
setup: true
|
||||
orbs:
|
||||
munitor: kof22/munitor@dev:snapshot
|
||||
workflows:
|
||||
setup:
|
||||
jobs:
|
||||
- munitor/generate_pipeline
|
||||
@@ -0,0 +1,13 @@
|
||||
name: build
|
||||
on:
|
||||
push:
|
||||
jobs:
|
||||
node:
|
||||
uses: self:KofTwentyTwo/ci-workflows/.gitea/workflows/node.yaml@v1
|
||||
secrets: inherit
|
||||
with:
|
||||
node-version: '22'
|
||||
# check = typecheck + vitest with the coverage thresholds enforced
|
||||
commands: |
|
||||
npm run build
|
||||
npm run check
|
||||
@@ -1,22 +0,0 @@
|
||||
name: Original Obsidian plugin build and release
|
||||
'on':
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
- feature/**
|
||||
- hotfix/**
|
||||
- release/**
|
||||
pull_request: {}
|
||||
workflow_dispatch: {}
|
||||
permissions:
|
||||
contents: write
|
||||
actions: read
|
||||
jobs:
|
||||
plugin:
|
||||
if: ${{ (github.head_ref || github.ref_name) == 'main' || (github.head_ref || github.ref_name) == 'develop' || startsWith((github.head_ref
|
||||
|| github.ref_name), 'feature/') || startsWith((github.head_ref || github.ref_name), 'hotfix/') || startsWith((github.head_ref
|
||||
|| github.ref_name), 'release/') }}
|
||||
uses: self:KofTwentyTwo/platform-ci/.gitea/workflows/munitor-obsidian.yaml@kof-release-v1
|
||||
with:
|
||||
runner: linux-small
|
||||
@@ -1,23 +0,0 @@
|
||||
# obsidian-plugin pipeline ships only in the Munitor `dev:snapshot` orb
|
||||
# build for now; v0.2.x stable releases don't include this template.
|
||||
# Bump to a stable tag once Munitor ships obsidian-plugin in a tagged release.
|
||||
pipeline: obsidian-plugin
|
||||
orb_version: dev:snapshot
|
||||
node_version: "20"
|
||||
sast: true
|
||||
sbom: true
|
||||
test:
|
||||
# `npm run check` = typecheck + vitest with coverage thresholds enforced.
|
||||
# Vitest exits non-zero on threshold violation, failing the build (gate 1).
|
||||
commands: ["npm run build", "npm run check"]
|
||||
coverage:
|
||||
tool: vitest
|
||||
command: npm run test:coverage
|
||||
# The orb's node_coverage job parses this summary and enforces
|
||||
# min_instruction independently — second layer of defense in case the
|
||||
# vitest threshold ever gets misconfigured. Ratchet up alongside
|
||||
# vitest.config.ts thresholds.
|
||||
summary_path: coverage/coverage-summary.json
|
||||
min_instruction: "90"
|
||||
contexts:
|
||||
github: github
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { describe, it, expect, vi } from "vitest";
|
||||
import { OllamaProvider } from "../../src/providers/ollama";
|
||||
import type { HttpFn, HttpResponse, CompletionRequest } from "../../src/providers/service";
|
||||
|
||||
@@ -283,14 +283,24 @@ describe("OllamaProvider", () => {
|
||||
});
|
||||
|
||||
it("throws connection refused message when Ollama is not running", async () => {
|
||||
let attempts = 0;
|
||||
const fn: HttpFn = async () => {
|
||||
attempts++;
|
||||
throw new Error("ECONNREFUSED");
|
||||
};
|
||||
const provider = new OllamaProvider(fn);
|
||||
// Zero the retry jitter: the default 3 retries back off up to 1+2+4 s at random,
|
||||
// which intermittently exceeded the 5 s test timeout.
|
||||
const random = vi.spyOn(Math, "random").mockReturnValue(0);
|
||||
|
||||
await expect(
|
||||
provider.complete(makeRequest()),
|
||||
).rejects.toThrow("Cannot connect to Ollama at http://localhost:11434. Is Ollama running?");
|
||||
try {
|
||||
await expect(
|
||||
provider.complete(makeRequest()),
|
||||
).rejects.toThrow("Cannot connect to Ollama at http://localhost:11434. Is Ollama running?");
|
||||
expect(attempts).toBe(4);
|
||||
} finally {
|
||||
random.mockRestore();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user