Skip to content
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
4 changes: 0 additions & 4 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,6 @@ component_management:
name: "@withstudiocms/kysely"
paths:
- packages/@withstudiocms/kysely/**
- component_id: withstudiocms_sdk
name: "@withstudiocms/sdk"
paths:
- packages/@withstudiocms/sdk/**
- component_id: withstudiocms_cli_kit
name: "@withstudiocms/cli-kit"
paths:
Expand Down
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
},
"vscode": {
"settings": {
"js/ts.tsdk.path": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.fixAll.biome": "explicit"
},
Expand Down
68 changes: 0 additions & 68 deletions .github/actions/allure-report/action.yml

This file was deleted.

41 changes: 31 additions & 10 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ jobs:
with:
persist-credentials: true

- name: Checkout Allure Test history
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: allure/history
path: test-history
persist-credentials: false

- name: Install Tools & Dependencies
uses: withstudiocms/automations/.github/actions/install@f32588d80ce35d57905264f7fa473b0f6e297c0a # main

Expand All @@ -80,17 +87,31 @@ jobs:
- name: Run Tests & Code Coverage
run: pnpm ci:test

# Allure Reports Require to be ran from within our repository only
# So we check if the PR is from a fork or from the same repository
- name: Generate Allure Report and Deploy
if: always() && (github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main')
uses: ./.github/actions/allure-report
# Only run on PRs
- name: Report Allure results
if: github.event_name == 'pull_request'
uses: allure-framework/allure-action@bd0373251ed3f1c5ac9aa44ac86ed40d839b3094 # v0.8.0
with:
report-directory: "./allure-report"
github-token: ${{ secrets.GITHUB_TOKEN }}

# Only upload Allure report results to Github if we are a push to main
- name: Upload Allure Report to Github Branch
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: allure/report
publish_dir: ./allure-report

# Only upload Allure report results to Github if we are a push to main
- name: Upload Allure History to Github Branch
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
gh_pages_branch: testing/allure
gh_page_history: testing/allure
allure_report_id: studiocms-tests
allure_report_dir: allure-results
cname: tests.studiocms.dev
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: allure/history
publish_dir: ./test-history

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ junit-report.xml
dist

# allure results
allure-results/*
allure-results
allure-report
history.jsonl

.env
.env
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"js/ts.tsdk.path": "node_modules/typescript/lib",
"editor.fontFamily": "Fira Code Retina, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 14.2,
Expand Down
75 changes: 75 additions & 0 deletions allurerc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { defineConfig } from 'allure';

const packagesWithTests = [
'studiocms',
'effectify',

'@studiocms/auth0',
'@studiocms/discord',
'@studiocms/github',
'@studiocms/google',
'@studiocms/devapps',
'@studiocms/html',
'@studiocms/cloudinary-image-service',
'@studiocms/md',
'@studiocms/mdx',
'@studiocms/blog',
'@studiocms/markdoc',
'@studiocms/markdown-remark',
'@studiocms/wysiwyg',

'@withstudiocms/auth-kit',
'@withstudiocms/buildkit',
'@withstudiocms/cli-kit',
'@withstudiocms/component-registry',
'@withstudiocms/config-utils',
'@withstudiocms/effect',
'@withstudiocms/internal_helpers',
'@withstudiocms/template-lang',
'@withstudiocms/kysely',
];

// Create a plugins configuration object for each package with tests, using the @allurereport/plugin-awesome plugin. The report will be named `${pkg} Tests`, and will be published to the Allure server.
const pluginsConfig = Object.fromEntries(
packagesWithTests.map((pkg) => [
pkg,
{
import: '@allurereport/plugin-awesome',
options: {
reportName: `${pkg} Tests`,
singleFile: false,
reportLanguage: 'en',
open: false,
publish: true,
groupBy: ['parentSuite', 'suite', 'subSuite'],
filter: ({ labels }) =>
labels.find(({ name, value }) => name === 'parentSuite' && value === `${pkg} Tests`),
},
},
])
);

// Export the Allure configuration object, which includes the plugins configuration for each package with tests, as well as some general settings for the Allure report.
export default defineConfig({
name: 'Allure Report',
output: './allure-report',
historyPath: './test-history/history.jsonl',
appendHistory: true,
historyLimit: 20,
qualityGate: {
rules: [
{
maxFailures: 0,
fastFail: true,
},
],
},
plugins: {
...pluginsConfig,
log: {
options: {
groupBy: 'none',
},
},
},
});
3 changes: 2 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@
"YYYYMMDDTHHMMSS",
"zipx",
"zizmor",
"zizmorcore"
"zizmorcore",
"allurereport"
]
}
8 changes: 7 additions & 1 deletion knip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,13 @@ const config: KnipConfig = {
exclude: ['duplicates', 'optionalPeerDependencies'],
workspaces: {
'.': {
ignoreDependencies: ['@changesets/config', 'studiocms', 'vite', 'allure-js-commons'],
ignoreDependencies: [
'@changesets/config',
'studiocms',
'vite',
'allure-js-commons',
'@allurereport/plugin-awesome',
],
ignoreBinaries: [/ci:.*$/, /bundle-test:.*$/, 'du'],
entry: ['.github/workflows/*.yml', '.github/scripts/**/*.mjs', 'scripts/**/*.mjs'],
project: ['.github/scripts/**/*.mjs', 'scripts/**/*.mjs'],
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@
"ci:version": "pnpm changeset version && pnpm ci:update-templates && pnpm install --no-frozen-lockfile && pnpm run lint:fix",
"ci:publish": "pnpm changeset publish",
"ci:snapshot": "pnpx pkg-pr-new publish --pnpm './packages/*'",
"ci:test": "vitest run --coverage",

"ci:vitest": "vitest run --coverage",
"ci:test": "allure run -- pnpm ci:vitest",
"ci:build": "pnpm build:packages",

"allure:view": "allure open allure-report",

"ci:typecheck:studiocms": "pnpm --filter studiocms typecheck",
"ci:typecheck:studiocms-packages": "pnpm --filter @studiocms/* --filter create-studiocms typecheck",
"ci:typecheck:withstudiocms": "pnpm --filter @withstudiocms/* --filter effectify typecheck",
Expand All @@ -83,6 +87,7 @@
},
"devDependencies": {
"@actions/core": "^3.0.1",
"@allurereport/plugin-awesome": "^3.14.2",
"@biomejs/biome": "^2.5.3",
"@changesets/changelog-github": "^0.7.0",
"@changesets/cli": "^2.31.0",
Expand All @@ -95,9 +100,9 @@
"@types/node": "catalog:",
"@vitest/coverage-v8": "^3.2.4",
"@withstudiocms/buildkit": "workspace:^",
"allure": "^3.14.2",
"allure-js-commons": "^3.10.2",
"allure-vitest": "^3.10.2",
"allure-commandline": "^2.43.0",
"execa": "^9.6.1",
"knip": "^6.26.0",
"pkg-pr-new": "^0.0.75",
Expand Down
2 changes: 1 addition & 1 deletion packages/@studiocms/auth0/test/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const parentSuiteName = '@studiocms/auth0 Package Tests';
export const parentSuiteName = '@studiocms/auth0 Tests';
export const sharedTags = ['package:@studiocms/auth0', 'type:unit', 'scope:studiocms'];
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,14 @@ Dashboard
footerYear.textContent = new Date().getFullYear();
</script> </body></html>"
`;

exports[`@studiocms/blog Tests > Layout renders correctly 1`] = `
"<html lang="en" id="blog-layout"> <head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Test Page | Test Site</title><link rel="canonical" href="https://example.com/"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/><link href="https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&amp;display=swap" rel="stylesheet"/><link rel="shortcut icon" href="/favicon.svg" type="image/svg+xml"/><meta name="title" content="Test Page | Test Site"/><meta name="description" content="This is a test page - A test site for StudioCMS"/><meta name="generator" content="Astro v0.0.0-test"/><meta name="generator" content="StudioCMS v0.0.0-test"/><meta property="og:title" content="Test Page | Test Site"/><meta property="og:type" content="website"/><meta property="og:url" content="https://example.com/"/><meta property="og:locale" content="en"/><meta property="og:description" content="This is a test page - A test site for StudioCMS"/><meta property="og:site_name" content="Test Page | Test Site"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:url" content="https://example.com/"/><meta name="twitter:title" content="Test Page | Test Site"/><meta name="twitter:description" content="This is a test page - A test site for StudioCMS"/><meta property="og:image" content="https://example.com/default-og-image.png"/><meta name="twitter:image" content="https://example.com/default-og-image.png"/></head> <body> <!-- If no dropdown items --><div class="navigation"><div class="title"><a href="/">Test Site</a></div><div class="mini-nav"><button>Menu</button><div class="mini-nav-content"><a href="/">Home</a><a href="/blog">Blog</a></div></div><a class="links" href="/">Home</a><a class="links" href="/blog">Blog</a><a class="avatar" href="/dashboard/login">
Dashboard
</a></div><!-- If dropdown items --> <footer>
&copy; <span id="footer-year">2026</span> Test Site. All rights reserved.
</footer> <script>
const footerYear = document.getElementById("footer-year");
footerYear.textContent = new Date().getFullYear();
</script> </body></html>"
`;
2 changes: 1 addition & 1 deletion packages/@studiocms/blog/test/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StudioCMSRoutes } from 'studiocms/lib/routeMap';

export const parentSuiteName = '@studiocms/blog Package Tests';
export const parentSuiteName = '@studiocms/blog Tests';
export const sharedTags = ['package:@studiocms/blog', 'type:unit', 'scope:studiocms'];

export function cleanAstroAttributes(str: string, mockPath: string): string {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const parentSuiteName = '@studiocms/cloudinary-image-service Package Tests';
export const parentSuiteName = '@studiocms/cloudinary-image-service Tests';
export const sharedTags = [
'package:@studiocms/cloudinary-image-service',
'type:unit',
Expand Down
2 changes: 1 addition & 1 deletion packages/@studiocms/devapps/tests/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const parentSuiteName = '@studiocms/devapps Package Tests';
export const parentSuiteName = '@studiocms/devapps Tests';
export const sharedTags = ['package:@studiocms/devapps', 'type:unit', 'scope:studiocms'];
2 changes: 1 addition & 1 deletion packages/@studiocms/discord/test/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const parentSuiteName = '@studiocms/discord Package Tests';
export const parentSuiteName = '@studiocms/discord Tests';
export const sharedTags = ['package:@studiocms/discord', 'type:unit', 'scope:studiocms'];
2 changes: 1 addition & 1 deletion packages/@studiocms/github/test/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const parentSuiteName = '@studiocms/github Package Tests';
export const parentSuiteName = '@studiocms/github Tests';
export const sharedTags = ['package:@studiocms/github', 'type:unit', 'scope:studiocms'];
2 changes: 1 addition & 1 deletion packages/@studiocms/google/test/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const parentSuiteName = '@studiocms/google Package Tests';
export const parentSuiteName = '@studiocms/google Tests';
export const sharedTags = ['package:@studiocms/google', 'type:unit', 'scope:studiocms'];
2 changes: 1 addition & 1 deletion packages/@studiocms/html/test/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { symbol as htmlSymbol } from '../src/lib/shared.js';
import type { HTMLSchemaOptions } from '../src/types.js';

export const parentSuiteName = '@studiocms/html Package Tests';
export const parentSuiteName = '@studiocms/html Tests';
export const sharedTags = ['package:@studiocms/html', 'type:unit', 'scope:studiocms'];

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/@studiocms/markdoc/test/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** biome-ignore-all lint/suspicious/noExplicitAny: allowed for tests */
import type { PluginPageTypeRendererProps } from 'studiocms/types';

export const parentSuiteName = '@studiocms/markdoc Package Tests';
export const parentSuiteName = '@studiocms/markdoc Tests';
export const sharedTags = ['package:@studiocms/markdoc', 'type:unit', 'scope:studiocms'];

export interface MarkDocRendererProps extends PluginPageTypeRendererProps {}
Expand Down
2 changes: 1 addition & 1 deletion packages/@studiocms/markdown-remark/test/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const parentSuiteName = '@studiocms/markdown-remark Package Tests';
export const parentSuiteName = '@studiocms/markdown-remark Tests';
export const sharedTags = ['package:@studiocms/markdown-remark', 'type:unit', 'scope:studiocms'];
2 changes: 1 addition & 1 deletion packages/@studiocms/md/test/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { symbol as mdSymbol } from '../src/lib/shared.js';
import type { StudioCMSMarkdownOptions } from '../src/types.js';

export const parentSuiteName = '@studiocms/md Package Tests';
export const parentSuiteName = '@studiocms/md Tests';
export const sharedTags = ['package:@studiocms/md', 'type:unit', 'scope:studiocms'];

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/@studiocms/mdx/test/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { MDXPluginOptions } from '../src/types.js';

export const parentSuiteName = '@studiocms/mdx Package Tests';
export const parentSuiteName = '@studiocms/mdx Tests';
export const sharedTags = ['package:@studiocms/mdx', 'type:unit', 'scope:studiocms'];

/**
Expand Down
Loading
Loading