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

New addon structure (cookieplone). Acceptance tests. #20

Closed
wants to merge 105 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
a837f04
New add-on structure with cookieplone
ksuess Oct 26, 2024
8e0c3ee
New add-on structure with cookieplone: add-on
ksuess Oct 26, 2024
caf8863
Add backend
ksuess Oct 26, 2024
cd54292
bring back volto-searchkit-block code
ksuess Oct 26, 2024
ec1072a
Create pnpm-lock.yaml
ksuess Oct 26, 2024
b0733d9
Remove searchkit.block package
ksuess Oct 27, 2024
e4cad60
backend: docker stuff for backend with collective.elastic.plone, Open…
ksuess Oct 27, 2024
fcf37c0
Fix cypress configuration
ksuess Oct 27, 2024
cd2eb71
Fix example cypress test
ksuess Oct 27, 2024
613ce1c
Update package version and add missing dependencies
ksuess Oct 27, 2024
13daf72
update locales
ksuess Oct 27, 2024
94f51d0
import matomoUtils
ksuess Oct 27, 2024
b6a4bc3
Test with released collective.elastic.plone
ksuess Oct 28, 2024
af7b12a
Update docker compose profile names
ksuess Oct 28, 2024
b8a03b9
ci-acceptance-backend-start with container with c.e.plone
ksuess Oct 28, 2024
c055b73
Trigger tests
ksuess Oct 28, 2024
db61905
Fix Makefile
ksuess Oct 28, 2024
15403be
Update acceptance.yml
ksuess Oct 28, 2024
53e420d
Update acceptance.yml
ksuess Oct 28, 2024
03357d9
Update acceptance.yml
ksuess Oct 28, 2024
b162b58
Fix path to ingest configuration
ksuess Oct 28, 2024
f63343a
docker compose: configuration of volumes
ksuess Oct 28, 2024
7b8239b
Create monolingual.search.cy.js
ksuess Oct 28, 2024
7973ce6
Update acceptance.yml
ksuess Oct 28, 2024
b60cdec
acceptance monolingual: Fix Volto settings
ksuess Oct 28, 2024
706ba9d
Add more monolingual tests
ksuess Oct 28, 2024
71333e9
Update monolingual.create_search.cy.js
ksuess Oct 28, 2024
1016d16
acceptance: Explicitly env variable SEARCHKITBLOCK_TESTING_LANGUAGESE…
ksuess Oct 28, 2024
7f2268c
add comment
ksuess Oct 28, 2024
c9ad6c8
Update monolingual.search.cy.js
ksuess Oct 28, 2024
4f6f459
acceptance: multilingual
ksuess Oct 28, 2024
b577520
Update multilingual.language.cy.js
ksuess Oct 28, 2024
e0b15b7
Update multilingual.search.anonymous.cy.js
ksuess Oct 28, 2024
a2aad69
Update multilingual.language.cy.js: catch hydration error
ksuess Oct 28, 2024
590e315
Update multilingual.language.cy.js: Do not Re-enable Cypress uncaught…
ksuess Oct 28, 2024
d24e9af
Disable Cypress uncaught exception failures from React hydration errors
ksuess Oct 28, 2024
1863a6f
Refactor settings: SEARCHKITBLOCK_TESTING_LANGUAGESETTINGS
ksuess Oct 28, 2024
4dca1fc
remove catcg hydr error
ksuess Oct 28, 2024
ba74fd6
Move tests to monolinugal or multilingual folder
ksuess Oct 28, 2024
3b0c46a
Update e2e.js
ksuess Oct 28, 2024
51b9516
rename actions
ksuess Oct 28, 2024
75d19e0
Fix multilingual settings (-> cy.settings)
ksuess Oct 29, 2024
07dffe3
uncomment default backend make commands
ksuess Oct 29, 2024
225a37a
Volto alpha 48
ksuess Oct 29, 2024
c821dbe
fix test with missing intercept
ksuess Oct 29, 2024
3b260da
trigger all tests
ksuess Oct 29, 2024
96477f3
test with Volto 18.0.0-alpha.46
ksuess Oct 29, 2024
012fa3a
test with 18.0.0-alpha.46
ksuess Oct 29, 2024
c4e70aa
Test with Volto 18.0.0-alpha.46
ksuess Oct 29, 2024
aac1ede
Test with Volto 18.0.0-alpha.47
ksuess Oct 29, 2024
c92560f
Update pnpm-lock.yaml
ksuess Oct 29, 2024
bebd343
Update i18n.yml
ksuess Oct 29, 2024
ea47cfe
Update Makefile
ksuess Oct 29, 2024
56a79c6
Some info about acceptance backend language
ksuess Oct 29, 2024
a9c75ca
Fix monolingual.create_search.cy.js: english
ksuess Oct 29, 2024
f93ec32
Get language from store (multilingual) or config (monolingual)
ksuess Oct 29, 2024
8898488
Remove debugging
ksuess Oct 30, 2024
3433392
cypress: Set settings.defaultLanguage = 'de'; on the fly
ksuess Oct 30, 2024
b806cc3
gh workflow: Fix push configuration
ksuess Oct 30, 2024
a3c4784
Fix import
ksuess Oct 30, 2024
b57a03f
cypress: add some waits after intercept and removeContent
ksuess Oct 30, 2024
fdf4d99
Update multilingual.search.cy.js
ksuess Oct 30, 2024
b3c3b70
Wait after creating content for ingest and OpenSearch to index
ksuess Oct 30, 2024
5ee9bfc
Update README.md
ksuess Oct 30, 2024
5d3c83d
Fix CI unit tests
ksuess Oct 31, 2024
1bd651b
Add testing fixtures package
ksuess Oct 31, 2024
95ba5fd
Include fixture package
ksuess Oct 31, 2024
5dbb62f
Volto "18.0.0-alpha.48"
ksuess Oct 31, 2024
c489b8a
screenshots: fix location
ksuess Oct 31, 2024
669d591
After including fixtures package: remove settings in cypress tests
ksuess Oct 31, 2024
3831908
Fix monolingual tests after fixture package
ksuess Oct 31, 2024
2d9a0fd
attac security issue
ksuess Oct 31, 2024
9190624
Fix Makefile indentation
ksuess Oct 31, 2024
bfc13ae
trigger GitGuardian Security Checks
ksuess Oct 31, 2024
c00a32b
:sparkles: add dev backend
ksuess Nov 1, 2024
252d3d2
Update README
ksuess Nov 1, 2024
ed58370
Volto 18 final
ksuess Nov 1, 2024
738692c
backend dev server monolingual and mutlilingual
ksuess Nov 2, 2024
312cd99
make commands start dev server with language settings by fixtures
ksuess Nov 2, 2024
4810b10
Replace former external backend testing profiles with new included
ksuess Nov 3, 2024
b2ed8ef
Fix acceptance tests multilingual after new backend profiles
ksuess Nov 3, 2024
ad7589c
dev backend
ksuess Nov 8, 2024
6b43b41
Update .gitignore
ksuess Nov 8, 2024
6505eef
Update README.md
ksuess Nov 8, 2024
f8b159e
Delete CHANGES.md
ksuess Nov 8, 2024
91e2e5e
create_site script with monolingual/multilingual
ksuess Nov 8, 2024
6e36fd4
Update multilingual.search.cy.js
ksuess Nov 8, 2024
2e914aa
some comments
ksuess Nov 8, 2024
ae34abe
re-enable make commands storybook
ksuess Nov 9, 2024
b824579
Update .gitignore
ksuess Nov 9, 2024
f5ebacd
Update dependencies.zcml
ksuess Nov 9, 2024
1964f3c
reduce to profiles monolingual and multilingual.
ksuess Nov 9, 2024
402d0e4
Apply behavior volto.blocks to LRF
ksuess Nov 9, 2024
092a9a8
dev environment: create_site, fix LRF
ksuess Nov 10, 2024
a8437cf
remove __pycache__
ksuess Nov 10, 2024
d34bd86
Fix .dev-env
ksuess Nov 10, 2024
381608d
create content, update content
ksuess Nov 10, 2024
2c12284
example content
ksuess Nov 10, 2024
056aa64
test with volto-bookmarks
ksuess Jan 12, 2025
4961eb5
Update .gitignore
ksuess Jan 12, 2025
129ffe0
CI NODE_VERSION: 22.x (was 20)
ksuess Jan 12, 2025
34974db
Update .eslintrc.js
ksuess Jan 12, 2025
a700101
Update code.yml
ksuess Jan 12, 2025
8f78932
Volto 18.6.0
ksuess Jan 12, 2025
d197218
pnpm workspace. explicit paths
ksuess Jan 12, 2025
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
42 changes: 42 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const fs = require('fs');
const projectRootPath = __dirname;
const { AddonRegistry } = require('@plone/registry/addon-registry');

let coreLocation;
if (fs.existsSync(`${projectRootPath}/core`))
coreLocation = `${projectRootPath}/core`;
else if (fs.existsSync(`${projectRootPath}/../../core`))
coreLocation = `${projectRootPath}/../../core`;

const { registry } = AddonRegistry.init(`${coreLocation}/packages/volto`);

// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
const addonAliases = Object.keys(registry.packages).map((o) => [
o,
registry.packages[o].modulePath,
]);

module.exports = {
extends: `${coreLocation}/packages/volto/.eslintrc`,
rules: {
'import/no-unresolved': 1,
},
settings: {
'import/resolver': {
alias: {
map: [
['@plone/volto', `${coreLocation}/packages/volto/src`],
['@plone/volto-slate', `${coreLocation}/packages/volto-slate/src`],
['@plone/registry', `${coreLocation}/packages/registry/src`],
['volto-searchkit-block', './packages/volto-searchkit-block/src'],
[
'@plone-collective/volto-bookmarks',
'./packages/volto-bookmarks/packages/volto-bookmarks/src',
],
...addonAliases,
],
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
},
},
},
};
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

73 changes: 0 additions & 73 deletions .github/workflows/acceptance.yml

This file was deleted.

105 changes: 105 additions & 0 deletions .github/workflows/acceptance_monolingual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Acceptance tests monolingual
on:
push:
paths:
- "*.js"
- "*.json"
- "*.yaml"
- "cypress/tests/monolingual/**"
- "packages/**"
- ".github/workflows/acceptance_monolingual.yml"
- "backend/dockerfiles/**"

env:
NODE_VERSION: 20.x
CYPRESS_RETRIES: 2

jobs:
acceptance-monolingual:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Cache Cypress Binary
id: cache-cypress-binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: binary-${{ env.NODE_VERSION }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Install dependencies
run: make install

- name: Install Cypress if not in cache
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
working-directory: core/packages/volto
run: make cypress-install

- uses: JarvusInnovations/background-action@v1
name: Start Servers
env:
INDEX_PASSWORD: ${{ secrets.SECRET_INDEX_PASSWORD}}
PLONE_PASSWORD: ${{ secrets.SECRET_PLONE_PASSWORD}}
with:
run: |
make ci-acceptance-backend-start-monolingual &
make acceptance-frontend-prod-start-monolingual &
# your step-level and job-level environment variables are available to your commands as-is
# npm install will count towards the wait-for timeout
# whenever possible, move unrelated scripts to a different step
# to background multiple processes: add & to the end of the command

wait-on: |
http-get://localhost:55001/plone
http://localhost:3000
# IMPORTANT: to use environment variables in wait-on, you must use this form: ${{ env.VAR }}
# See wait-on section below for all resource types and prefixes

tail: true # true = stderr,stdout
# This will allow you to monitor the progress live

log-output-resume: stderr
# Eliminates previosuly output stderr log entries from post-run output

wait-for: 10m

log-output: stderr,stdout # same as true

log-output-if: failure

- run: make ci-acceptance-test-monolingual

# Upload Cypress screenshots
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots-acceptance
path: cypress/screenshots

# Upload Cypress videos
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos-acceptance
path: cypress/videos
106 changes: 106 additions & 0 deletions .github/workflows/acceptance_multilingual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Acceptance tests multilingual
on:
push:
paths:
- "*.js"
- "*.json"
- "*.yaml"
- "cypress/tests/multilingual/**"
- "packages/**"
- ".github/workflows/acceptance_multilingual.yml"
- "backend/dockerfiles/**"

env:
NODE_VERSION: 20.x
CYPRESS_RETRIES: 2

jobs:
acceptance-multilingual:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Cache Cypress Binary
id: cache-cypress-binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: binary-${{ env.NODE_VERSION }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Install dependencies
run: make install

- name: Install Cypress if not in cache
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
working-directory: core/packages/volto
run: make cypress-install

- uses: JarvusInnovations/background-action@v1
name: Start Servers
env:
INDEX_PASSWORD: ${{ secrets.SECRET_INDEX_PASSWORD}}
PLONE_PASSWORD: ${{ secrets.SECRET_PLONE_PASSWORD}}
with:
run: |
make ci-acceptance-backend-start-multilingual &
make acceptance-frontend-prod-start-multilingual &
# your step-level and job-level environment variables are available to your commands as-is
# npm install will count towards the wait-for timeout
# whenever possible, move unrelated scripts to a different step
# to background multiple processes: add & to the end of the command

wait-on: |
http-get://localhost:55001/plone
http://localhost:3000
# IMPORTANT: to use environment variables in wait-on, you must use this form: ${{ env.VAR }}
# See wait-on section below for all resource types and prefixes

tail: true # true = stderr,stdout
# This will allow you to monitor the progress live

log-output-resume: stderr
# Eliminates previosuly output stderr log entries from post-run output

wait-for: 10m

log-output: stderr,stdout # same as true

log-output-if: failure

- run: make ci-acceptance-test-multilingual

# Upload Cypress screenshots
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots-acceptance
path: cypress/screenshots

# Upload Cypress videos
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos-acceptance
path: cypress/videos

35 changes: 25 additions & 10 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
- main

env:
node-version: 20.x
NODE_VERSION: 20.x
ADDON_NAME: volto-searchkit-block

jobs:
build:
Expand All @@ -20,24 +21,38 @@ jobs:
- name: Install pipx
run: pip install towncrier

# node setup
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
cache: 'yarn'
node-version: ${{ env.NODE_VERSION }}

- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

# node install
- name: Install dependencies
run: yarn
run: |
make install

- name: Check for presence of a Change Log fragment (only pull requests)
run: |
# Fetch the pull request' base branch so towncrier will be able to
# compare the current branch with the base branch.
# Source: https://github.com/actions/checkout/#fetch-all-branches.
git fetch --no-tags origin main
towncrier check --compare-with origin/main
git fetch --no-tags origin ${BASE_BRANCH}
towncrier check --dir packages/${ADDON_NAME}
env:
BASE_BRANCH: ${{ github.base_ref }}
if: github.event_name == 'pull_request'
Loading
Loading