Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test full master manifest in CI #116

Merged
merged 2 commits into from
Mar 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,17 @@ jobs:

- run: bun install
- run: bun lint
- run: bun vitest
- run: bun run test

manifest:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1

- run: bun install
- name: test manifest in master
run: bun run test "manifest"
env:
MANIFEST_BRANCH: master
8 changes: 5 additions & 3 deletions src/utils/manifest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as Comlink from 'comlink'
import config from '../config'
import { getManifest } from './manifest'

const MANIFEST_BRANCH = import.meta.env.MANIFEST_BRANCH

globalThis.navigator = {
storage: {
estimate: vi.fn().mockImplementation(() => ({ quota: 10 * (1024 ** 3) })),
Expand Down Expand Up @@ -32,7 +34,7 @@ vi.resetModules() // this makes the import be reevaluated on each call
await import('./../workers/image.worker')

for (const [branch, manifestUrl] of Object.entries(config.manifests)) {
describe(`${branch} manifest`, async () => {
describe.skipIf(MANIFEST_BRANCH && branch !== MANIFEST_BRANCH)(`${branch} manifest`, async () => {
const images = await getManifest(manifestUrl)

// Check all images are present
Expand All @@ -58,9 +60,9 @@ for (const [branch, manifestUrl] of Object.entries(config.manifests)) {
}
})

test('download', async () => {
test.skipIf(image.name === 'system' && !MANIFEST_BRANCH)('download', async () => {
await imageWorker.downloadImage(image)
}, { skip: image.name === 'system', timeout: 8 * 1000 })
}, { timeout: (image.name === 'system' ? 11 * 60 : 8) * 1000 })
})
}
})
Expand Down
Loading