Skip to content

Update to Patternfly 6 #543

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

Merged
merged 1 commit into from
Jan 15, 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
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;
12 changes: 8 additions & 4 deletions cypress/e2e/1_acess_management.cy.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
describe('Global stats', () => {
describe('Access Management', () => {
beforeEach(() => {
// cleanup created data
cy.cleanupTest(Cypress.env('username'), Cypress.env('password'), '/security/permissions/aRole')
cy.cleanupTest(Cypress.env('username'), Cypress.env('password'), '/security/roles/aPrincipal?action=grant')
// logs in the access management page
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 Expand Up @@ -71,13 +75,13 @@ describe('Global stats', () => {
});

it('successfully creates, updates and removes a principal', () => {
cy.login(Cypress.env('username'), Cypress.env('password'), '/access-management');
// Log in the console
cy.get('[aria-label=nav-item-principals').click();
cy.contains('No principal role mappers').click();
cy.get('[data-cy=grantAccessPrincipalButton').click();
cy.get("[aria-label=principal-name-input]").type("aPrincipal");
cy.get("[data-cy=menu-toogle-roles]").click();
cy.get("[data-cy=option-typeahead-deployer]").click();
cy.get("[data-cy=option-typeahead-deployer]").click({animationDistanceThreshold: 20});
cy.get("[data-cy=menu-toogle-roles]").click();
cy.get('[aria-label=Save').click();
cy.contains('Access granted to aPrincipal.');
Expand Down
63 changes: 30 additions & 33 deletions cypress/e2e/1_cluster-welcome.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
describe('Welcome page', () => {
function clickSideBar() {
cy.get('[data-cy=sideBarToggle]').click();
}

it('successfully loads Welcome page', () => {
cy.visit('/welcome', {
headers: {
Expand Down Expand Up @@ -40,50 +44,43 @@ describe('Welcome page', () => {

it('successfully opens and navigates side menu', () => {
cy.login(Cypress.env('username'), Cypress.env('password'));

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();
// Show sidebar
clickSideBar();
//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');
cy.contains('Access Management').should('be.visible');
cy.contains('Connected Clients').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 side menu Data Container
cy.get('[itemid="data_container"]').click();
cy.contains('Data container');
cy.contains('LON');
cy.contains('Tracing is enabled');
cy.contains('Cluster rebalancing on');

//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 side menu Global Statistics
cy.get('[itemid="global_stats"]').click();
cy.contains('Global statistics');

//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 side menu Cluster membership
cy.get('[itemid="cluster_membership"]').click();
cy.contains('Cluster membership');
cy.contains('Healthy');
cy.contains('1 member in use');

//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 side menu Access management
cy.get('[itemid="access_management"]').click();
cy.contains('Access management');
cy.contains('admin');

//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
//Clicks the side menu Access management
cy.get('[itemid="connected_clients"]').click();
cy.contains('Connected clients');
cy.contains('Server node');
});

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
Loading