Skip to content

Commit e65cee5

Browse files
committed
Fix pipeline errors
1 parent 862820c commit e65cee5

4 files changed

Lines changed: 38 additions & 5 deletions

File tree

‎.github/workflows/continuous-deployment.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ jobs:
184184
GH_TOKEN: ${{ github.token }}
185185
run: |
186186
set -euo pipefail
187-
.github/scripts/download_packages.sh
188-
SUITE=latest DOCUMENTDB_VERSION="$DOCUMENTDB_LATEST_VERSION" .github/scripts/download_packages.sh
187+
bash .github/scripts/download_packages.sh
188+
SUITE=latest DOCUMENTDB_VERSION="$DOCUMENTDB_LATEST_VERSION" bash .github/scripts/download_packages.sh
189189
- name: Verify generated package components
190190
if: steps.features.outputs.packages == 'true'
191191
env:

‎.github/workflows/continuous-integration.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ jobs:
102102
GH_TOKEN: ${{ github.token }}
103103
run: |
104104
set -euo pipefail
105-
.github/scripts/download_packages.sh
105+
bash .github/scripts/download_packages.sh
106106
# Unpinned, like the deploy while DOCUMENTDB_LATEST_VERSION is unset.
107-
SUITE=latest DOCUMENTDB_VERSION=latest .github/scripts/download_packages.sh
107+
SUITE=latest DOCUMENTDB_VERSION=latest bash .github/scripts/download_packages.sh
108108
- name: Verify release inventory and metadata
109109
run: python3 .github/scripts/verify_package_inventory.py
110110
- name: Resolve both PostgreSQL majors and retired endpoints

‎readme.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ The first time you run `npm run dev` or `npm run build`, documentation content w
7575

7676
We welcome contributions to improve the DocumentDB website, whether it's blog posts, bug fixes, or enhancements to the site itself.
7777
78+
### Running checks
79+
80+
```bash
81+
npm run lint
82+
npm test
83+
```
84+
85+
CI runs tests before compiling upstream documentation. Use self-contained fixtures for imported-content tests rather than depending on the generated `articles/` or `reference/` trees, which are absent on a fresh checkout.
86+
7887
### Contributing Announcements and Blog Posts
7988
8089
Announcements and blog posts are managed locally in this repository. Contribute directly through a pull request to this repository.

‎tests/discoveryContent.test.tsx‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import fs from "node:fs";
2+
import path from "node:path";
13
import { createElement } from "react";
24
import { renderToStaticMarkup } from "react-dom/server";
35
import matter from "gray-matter";
@@ -36,7 +38,29 @@ describe("static discovery content", () => {
3638
});
3739

3840
it("preserves upstream architecture content", () => {
39-
const source = matter(articles.getMarkdownContent("architecture"));
41+
const markdown = `---
42+
title: Upstream architecture
43+
description: Architecture documentation from upstream.
44+
layout: coming-soon
45+
---
46+
47+
Architecture details will be published here.
48+
`;
49+
const directory = path.join(process.cwd(), "articles", "architecture");
50+
const files = new Map([
51+
[path.join(directory, "index.md"), markdown],
52+
[path.join(directory, "navigation.yml"), "- title: Architecture\n link: index.md\n"],
53+
]);
54+
const existsSync = fs.existsSync;
55+
const readFileSync = fs.readFileSync;
56+
vi.spyOn(fs, "existsSync").mockImplementation((file) =>
57+
files.has(file.toString()) || existsSync(file),
58+
);
59+
vi.spyOn(fs, "readFileSync").mockImplementation((file, options) =>
60+
files.get(file.toString()) ?? readFileSync(file, options),
61+
);
62+
63+
const source = matter(markdown);
4064
const architecture = articles.getArticleByPath("architecture");
4165
expect(architecture?.content).toBe(source.content);
4266
expect(architecture?.frontmatter).toEqual(source.data);

0 commit comments

Comments
 (0)