Skip to content

Commit

Permalink
Upgrades to Patternfly 6
Browse files Browse the repository at this point in the history
  • Loading branch information
karesti committed Jan 10, 2025
1 parent 300b4be commit cdcf381
Show file tree
Hide file tree
Showing 144 changed files with 5,441 additions and 6,231 deletions.
45 changes: 43 additions & 2 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,49 @@ jobs:
name: Start 2 Cross-site Infinispan Servers Latest Version
shell: bash
run: |
docker run -d -p 11222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigLON.xml:/user-config/e2eTestsConfigLON.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main -c "infinispan-xsite.xml" -c "/user-config/e2eTestsConfigLON.xml"
docker run -d -p 31222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigNYC.xml:/user-config/e2eTestsConfigNYC.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main -c "infinispan-xsite.xml" -c "/user-config/e2eTestsConfigNYC.xml"
docker run -d -p 11222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigLON.xml:/user-config/e2eTestsConfigLON.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main --node-name=infinispan-4-lon-e2e -c "infinispan-xsite.xml" -c "/user-config/e2eTestsConfigLON.xml"
docker run -d -p 31222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigNYC.xml:/user-config/e2eTestsConfigNYC.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main --node-name=infinispan-4-nyc-e2e -c "infinispan-xsite.xml" -c "/user-config/e2eTestsConfigNYC.xml"
# Wait for server to startup
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:11222/rest/v2/cache-managers/default/health/status > /dev/null
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:31222/rest/v2/cache-managers/default/health/status > /dev/null
#Installing Nashorn dependencies
#Adding nashorn libraries to both containers
for containerId in $(docker ps -q)
do
docker exec -i $containerId /opt/infinispan/bin/cli.sh install org.openjdk.nashorn:nashorn-core:15.4
docker exec -i $containerId /opt/infinispan/bin/cli.sh install org.ow2.asm:asm:9.4
docker exec -i $containerId /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-commons:9.4
docker exec -i $containerId /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-tree:9.4
docker exec -i $containerId /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-util:9.4
done
# It's not possible to use GH action services, as we need to mount custom configuration from checked out source to the server
- if: github.base_ref == '15.0' || github.ref_name == '15.0'
name: Start 2 Cross-site Infinispan Servers Latest Version
shell: bash
run: |
docker run -d -p 11222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigLON.xml:/user-config/e2eTestsConfigLON.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan/server:15.0 --node-name=infinispan-4-lon-e2e -c "infinispan-xsite.xml" -c "/user-config/e2eTestsConfigLON.xml"
docker run -d -p 31222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigNYC.xml:/user-config/e2eTestsConfigNYC.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan/server:15.0 --node-name=infinispan-4-nyc-e2e -c "infinispan-xsite.xml" -c "/user-config/e2eTestsConfigNYC.xml"
# Wait for server to startup
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:11222/rest/v2/cache-managers/default/health/status > /dev/null
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:31222/rest/v2/cache-managers/default/health/status > /dev/null
#Installing Nashorn dependencies
#Adding nashorn libraries to both containers
for containerId in $(docker ps -q)
do
docker exec -i $containerId /opt/infinispan/bin/cli.sh install org.openjdk.nashorn:nashorn-core:15.4
docker exec -i $containerId /opt/infinispan/bin/cli.sh install org.ow2.asm:asm:9.4
docker exec -i $containerId /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-commons:9.4
docker exec -i $containerId /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-tree:9.4
docker exec -i $containerId /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-util:9.4
done
# It's not possible to use GH action services, as we need to mount custom configuration from checked out source to the server
- if: github.base_ref == '15.1' || github.ref_name == '15.1'
name: Start 2 Cross-site Infinispan Servers Latest Version
shell: bash
run: |
docker run -d -p 11222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigLON.xml:/user-config/e2eTestsConfigLON.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan/server:15.1 --node-name=infinispan-4-lon-e2e -c "infinispan-xsite.xml" -c "/user-config/e2eTestsConfigLON.xml"
docker run -d -p 31222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigNYC.xml:/user-config/e2eTestsConfigNYC.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan/server:15.1 --node-name=infinispan-4-nyc-e2e -c "infinispan-xsite.xml" -c "/user-config/e2eTestsConfigNYC.xml"
# Wait for server to startup
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:11222/rest/v2/cache-managers/default/health/status > /dev/null
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:31222/rest/v2/cache-managers/default/health/status > /dev/null
Expand Down
17 changes: 17 additions & 0 deletions __mocks__/keycloak-js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// __mocks__/keycloak-js.js

// Mock implementation of the Keycloak class
const Keycloak = jest.fn(() => ({
init: jest.fn().mockResolvedValue(true), // Mocks successful initialization
login: jest.fn().mockResolvedValue(true), // Mocks successful login
logout: jest.fn().mockResolvedValue(true), // Mocks successful logout
authenticated: true, // Mocks that the user is authenticated
accountManagement: jest.fn(), // Mocks account management
token: 'mock-token', // Mocks a token
updateToken: jest.fn().mockResolvedValue(true), // Mocks token refresh
authServerUrl: 'http://mock-server-url', // Mocks the auth server URL
realm: 'mock-realm', // Mocks the realm
}));

// Export the mock class
module.exports = Keycloak;
4 changes: 2 additions & 2 deletions cypress/e2e/1_acess_management.cy.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
describe('Global stats', () => {
describe('Access Management', () => {
beforeEach(() => {
cy.login(Cypress.env('username'), Cypress.env('password'), '/access-management');
});

it('successfully loads Access Management page', () => {
it('successfully loads the page', () => {
cy.get('h1').should('contain', 'Access management');
cy.contains('admin');
cy.contains('Superuser');
Expand Down
41 changes: 4 additions & 37 deletions cypress/e2e/1_cluster-welcome.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Welcome page', () => {
cy.contains('Tracing is enabled'); // tracing status
cy.contains('16 Caches');
cy.contains('10 Counters');
cy.contains('1 Tasks');
// cy.contains('1 Tasks');
cy.contains('13 Schemas');
cy.contains('invalidationCache');

Expand All @@ -44,46 +44,13 @@ describe('Welcome page', () => {
cy.contains('Data container');
cy.contains('Running'); // cluster status

//Checks if navigation menu is hidden
cy.contains('Data Container').should('not.be.visible');
cy.contains('Global Statistics').should('not.be.visible');
cy.contains('Cluster Membership').should('not.be.visible');

cy.get('#nav-toggle').click();
cy.get('[data-cy=sideBarToggle]').click();
//Checks if navigation menu is visible
cy.contains('Data Container').should('be.visible');
cy.contains('Global Statistics').should('be.visible');
cy.contains('Cluster Membership').should('be.visible');

//Clicks the Cluster Membership link and should go to Cluster Membership page
cy.contains('Cluster Membership').click();
cy.contains('Cluster membership').should('be.visible');
cy.contains('Healthy');
cy.contains('infinispan-4-e2e');

//Clicks the Global statistics link and should go to Global statistics page
cy.contains('Global Statistics').click();
cy.contains('Global statistics').should('be.visible');
cy.contains('Cluster-wide statistics');
cy.contains('Cache Manager lifecycle values');

//Clicks the Access management link and should go to Access management page
cy.contains('Access Management').click();
cy.contains('Access management').should('be.visible');
cy.contains('Access control');
cy.contains('Create role');

//Clicks the Connected clients link and should go to Connected clients page
cy.contains('Connected Clients').click();
cy.contains('Connected clients').should('be.visible');
cy.contains('Client library');
cy.contains('Server node');

//Clicks the Data Container link and should go to Data Container page
cy.contains('Data Container').click();
cy.contains('Data container').should('be.visible');
cy.contains('Running'); // cluster status
cy.contains('Cluster rebalancing on'); // rebalancing status
cy.contains('Access Management').should('be.visible');
cy.contains('Connected Clients').should('be.visible');
});

it('successfully opens and views About page', () => {
Expand Down
65 changes: 17 additions & 48 deletions cypress/e2e/1_data-container.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ describe('Data Container Overview', () => {
cy.contains('Running'); // cluster status
cy.contains('Tracing is enabled');
cy.contains('Cluster rebalancing on'); // rebalancing status
cy.get('#cluster-manager-header').should('exist');
cy.get('[data-cy=cacheManagerStatus]').should('exist');
cy.get('[data-cy="statusInfo-clusterManager"]').should('exist');
cy.get('[data-ouia-component-id=cluster-manager-header-title]').should('exist');
cy.get('[data-cy=rebalancingSwitch]').should('exist');
cy.get('[data-cy=navigationTabs]').should('exist');
cy.get('#cache-table-toolbar').should('exist');
Expand All @@ -23,11 +23,12 @@ describe('Data Container Overview', () => {
cy.get('[data-cy=cachesTable]').should('exist');
cy.contains('default'); // cache default
cy.contains('octet-stream-cache').should('not.exist'); // cache octet-stream-cache is already on the next page

//make sure there are total 4 tabs (0,1,2,3)
cy.get('a[aria-label="nav-item-Caches"]').click();
cy.get('a[aria-label="nav-item-Tasks"]').click();
cy.get('a[aria-label="nav-item-Counters"]').click();
cy.get('a[aria-label="nav-item-Schemas"]').click();
cy.get('[data-cy="tab-Caches"]').click({multiple: true, force: true});
cy.get('[data-cy="tab-Tasks"]').click({multiple: true, force: true});
cy.get('[data-cy="tab-Counters"]').click({multiple: true, force: true});
cy.get('[data-cy="tab-Schemas"]').click({multiple: true, force: true});
});

//Testing pagination and navigation
Expand Down Expand Up @@ -60,53 +61,21 @@ describe('Data Container Overview', () => {
cy.contains('xml-cache').should('not.exist');

//Changing the number of items on the page
cy.get('[id^="pagination-caches-top-pagination"]').first().click();
cy.get('[data-action=per-page-10] .pf-v5-c-menu__item-select-icon').should('exist'); //Verifying the selected option
cy.get('[data-action=per-page-20] .pf-v5-c-menu__item-select-icon').should('not.exist');
cy.get('[data-action=per-page-50] .pf-v5-c-menu__item-select-icon').should('not.exist');
cy.get('[data-action=per-page-100] .pf-v5-c-menu__item-select-icon').should('not.exist');
cy.contains('1 - 10 of 16');
cy.get('[id^="pagination-caches-top-toggle"]').first().click();
cy.get('[data-action=per-page-10]').should('exist');
cy.get('[data-action=per-page-20]').should('exist');
cy.get('[data-action=per-page-50]').should('exist');
cy.get('[data-action=per-page-100]').should('exist');
cy.get('[data-action=per-page-20]').click();

//Verifying that all caches are shown and navigation buttons are disabled
cy.get('[id^="pagination-caches-top-pagination"]').first().click();
cy.get('[data-action=per-page-10] .pf-v5-c-menu__item-select-icon').should('not.exist'); //Verifying the selected option
cy.get('[data-action=per-page-20] .pf-v5-c-menu__item-select-icon').should('exist');
cy.get('[data-action=per-page-50] .pf-v5-c-menu__item-select-icon').should('not.exist');
cy.get('[data-action=per-page-100] .pf-v5-c-menu__item-select-icon').should('not.exist');
cy.contains('1 - 16 of 16');
cy.get('[data-cy=cachesTable] tr').should('have.length', numberOfCaches + 1); // including header row
cy.get('[data-action=next]').first().should('be.disabled');
cy.get('[data-action=previous]').first().should('be.disabled');
cy.contains('java-serialized-cache');
cy.contains('people');
cy.contains('xml-cache');

//Changing the number of items on the page to 3rd option
cy.get('[data-action=per-page-50]').click();
cy.get('[id^="pagination-caches-top-pagination"]').first().click();
cy.get('[data-action=per-page-10] .pf-v5-c-menu__item-select-icon').should('not.exist'); //Verifying the selected option
cy.get('[data-action=per-page-20] .pf-v5-c-menu__item-select-icon').should('not.exist');
cy.get('[data-action=per-page-50] .pf-v5-c-menu__item-select-icon').should('exist');
cy.get('[data-action=per-page-100] .pf-v5-c-menu__item-select-icon').should('not.exist');
cy.get('[data-cy=cachesTable] tr').should('have.length', numberOfCaches + 1); //including header row
cy.get('[data-action=next]').first().should('be.disabled');
cy.get('[data-action=previous]').first().should('be.disabled');
cy.contains('java-serialized-cache');
cy.contains('people');
cy.contains('xml-cache');

//Changing the number of items on the page to 4th option
cy.get('[data-action=per-page-100]').click();
cy.get('[id^="pagination-caches-top-pagination"]').first().click();
cy.get('[data-action=per-page-10] .pf-v5-c-menu__item-select-icon').should('not.exist'); //Verifying the selected option
cy.get('[data-action=per-page-20] .pf-v5-c-menu__item-select-icon').should('not.exist');
cy.get('[data-action=per-page-50] .pf-v5-c-menu__item-select-icon').should('not.exist');
cy.get('[data-action=per-page-100] .pf-v5-c-menu__item-select-icon').should('exist');
cy.get('[data-cy=cachesTable] tr').should('have.length', numberOfCaches + 1); //including header row
cy.get('[data-action=next]').first().should('be.disabled');
cy.get('[data-action=previous]').first().should('be.disabled');
cy.contains('java-serialized-cache');
cy.contains('people');
cy.contains('xml-cache');
});

//Testing the filters
Expand Down Expand Up @@ -182,7 +151,7 @@ describe('Data Container Overview', () => {
cy.contains('java-serialized-cache').should('not.exist');

//Changing the number of caches on the page to view them all
cy.get('[id^="pagination-caches-top-pagination"]').first().click();
cy.get('[id^="pagination-caches-top-toggle"]').first().click();
cy.get('[data-action=per-page-20]').click();
cy.contains('not-encoded');
cy.contains('xml-cache');
Expand Down Expand Up @@ -310,8 +279,8 @@ describe('Data Container Overview', () => {
cy.get('[data-cy=dataContainerLink]').click(); //Clicking on breadcrumb link.

//Is redirected to Data Container page
cy.get('#cluster-manager-header').should('exist');
cy.get('[data-cy=cacheManagerStatus]').should('exist');
cy.get('[data-ouia-component-id=cluster-manager-header-title]').should('exist');
cy.get('[data-cy="statusInfo-clusterManager"]').should('exist');
cy.get('[data-cy=rebalancingSwitch]').should('exist');

//Go to Config page again
Expand Down
Loading

0 comments on commit cdcf381

Please sign in to comment.