Skip to content

Commit

Permalink
BACKLOG-22005 Update default config (#8)
Browse files Browse the repository at this point in the history
* BACKLOG-22005 Update default config

* BACKLOG-22005 Allow to get test filtering with just default config

* BACKLOG-22005 Update test reporter
  • Loading branch information
AKarmanov authored Jan 16, 2024
1 parent 73a7424 commit c1094e3
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 18 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/manual-run.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# This workflows can be triggered manually via the GitHub actions UI
# It is used to trigger an integration tests run using snapshot artifacts
# You can customize it with any parameters necesasry.
# Note that workflow_dispatch workflows are only available from master.
# So you'll need to first merge it to be able to start testing it, but once
# Note that workflow_dispatch workflows are only available from master.
# So you'll need to first merge it to be able to start testing it, but once
# a first version is merged, you can point the GitHub UI towards a manual-run.yml workflow in a branch
# So merge this one early, even if its configuration is not fully finalized
#
#
# Github actions command reference: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
# Our GitHub Action is available here: https://github.com/Jahia/jahia-modules-action
name: Manual Tests Run

on:
on:
workflow_dispatch:
inputs:
jahia_image:
Expand All @@ -32,10 +32,10 @@ jobs:
- uses: actions/checkout@v4
- uses: KengoTODA/actions-setup-docker-compose@main
with:
version: '1.29.2'
version: '1.29.2'
- uses: actions/setup-node@v2
with:
node-version: 'lts/*'
node-version: 'lts/*'
- uses: jahia/jahia-modules-action/integration-tests@v2
with:
module_id: richtext-configuration
Expand Down Expand Up @@ -64,10 +64,11 @@ jobs:
incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_API_KEY_BASE64 }}
zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }}
- name: Test Report
uses: dorny/test-reporter@v1
uses: phoenix-actions/test-reporting@v12
if: success() || failure()
with:
name: Tests Report (Standalone)
path: tests/artifacts/results/xml_reports/*.xml
name: Tests Report (Manual Run)
path: tests/artifacts/results/xml_reports/**/*.xml
reporter: java-junit
fail-on-error: 'false'
output-to: 'step-summary'
13 changes: 13 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,16 @@ jobs:
incident_google_client_email: ${{ secrets.INCIDENT_GOOGLE_CLIENT_EMAIL }}
incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_PRIVATE_KEY_BASE64 }}
zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }}
- name: Test Report
uses: phoenix-actions/test-reporting@v12
id: test-report
if: success() || failure()
with:
name: Nightly
path: tests/artifacts/results/xml_reports/**/*.xml
reporter: java-junit
fail-on-error: 'false'
output-to: 'step-summary'
- name: Print test report URL
run: |
echo "Test report URL is ${{ steps.test-report.outputs.runHtmlUrl }}"
8 changes: 4 additions & 4 deletions .github/workflows/on-code-change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ jobs:
incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_API_KEY_BASE64 }}
zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }}
- name: Test Report
uses: dorny/test-reporter@v1
uses: phoenix-actions/test-reporting@v12
if: success() || failure()
with:
name: Tests Report (Standalone)
name: Tests Report
path: tests/artifacts/results/xml_reports/**/*.xml
reporter: java-junit
fail-on-error: 'false'

output-to: 'checks'
sonar-analysis:
name: Sonar Analysis
needs: build
Expand All @@ -104,4 +104,4 @@ jobs:
# primary_release_branch: master
github_pr_id: ${{github.event.number}}
sonar_url: ${{ secrets.SONAR_URL }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
5 changes: 3 additions & 2 deletions .github/workflows/on-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ jobs:
incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_API_KEY_BASE64 }}
zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }}
- name: Test Report
uses: dorny/test-reporter@v1
uses: phoenix-actions/test-reporting@v12
if: success() || failure()
with:
name: Tests Report (Standalone)
name: Tests Report ${{ matrix.config_file }}
path: tests/artifacts/results/xml_reports/**/*.xml
reporter: java-junit
fail-on-error: 'false'
output-to: 'checks'

publish:
name: Publish module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public GqlHTMLFilteringTest getTestFiltering(@GraphQLNonNull @GraphQLName("siteK
RichTextConfigurationInterface filteringConfig = BundleUtils.getOsgiService(RichTextConfigurationInterface.class, null);
GqlHTMLFilteringTest gqlHTMLFilteringTest = new GqlHTMLFilteringTest();

if (filteringConfig == null || !filteringConfig.configExists(siteKey)) {
if (filteringConfig == null) {
gqlHTMLFilteringTest.setHtml(html);
return gqlHTMLFilteringTest;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ htmlFiltering:
- mailto
attributes:
- name: class
pattern: "(myclass1|myclass2)"
- name: dir
- name: hidden
- name: id
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/filteringAPI.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('HTML rich text filtering API', () => {
attribute: 'class',
elements: [],
isGlobal: true,
pattern: '(myclass1|myclass2)',
pattern: null,
__typename: 'GqlRichTextConfigAttribute'
});
expect(response.data.richtextConfiguration.htmlFiltering.richtextConfiguration.attributes.find(a => a.attribute === 'autoplay')).to.deep.equal({
Expand Down

0 comments on commit c1094e3

Please sign in to comment.