diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index 4b97b3f32..d8c9cc2a0 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -32,17 +32,24 @@ jobs: # 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 == 'main' || github.ref_name == 'main' - name: Start Infinispan Server Latest Version + 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/infinispan-basic-auth.xml:/opt/infinispan/server/conf/infinispan.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main --node-name=infinispan-4-e2e + 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/infinispan-basic-auth.xml:/opt/infinispan/server/conf/infinispan.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-e2e + 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/infinispan-basic-auth.xml:/opt/infinispan/server/conf/infinispan.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-e2e # 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 - docker exec $(docker ps -q -l) /opt/infinispan/bin/cli.sh install org.openjdk.nashorn:nashorn-core:15.4 - docker exec $(docker ps -q -l) /opt/infinispan/bin/cli.sh install org.ow2.asm:asm:9.4 - docker exec $(docker ps -q -l) /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-commons:9.4 - docker exec $(docker ps -q -l) /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-tree:9.4 - docker exec $(docker ps -q -l) /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-util:9.4 + #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 - if: github.base_ref == '14.x' || github.ref_name == '14.x' name: Start Infinispan Server 14.x Version @@ -57,11 +64,12 @@ jobs: docker exec $(docker ps -q -l) /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-tree:9.4 docker exec $(docker ps -q -l) /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-util:9.4 - - name: Restarting Infinispan Server After Nashorn Installation + - name: Restarting Infinispan Servers After Nashorn Installation run: | - docker restart $(docker ps -q -l) - # Wait for server to startup + docker restart $(docker ps -q) + # Wait for servers 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 - name: Initialize Infinispan Server run: cd data; bash ./create-data.sh admin password diff --git a/cypress/e2e/1_cluster-welcome.cy.js b/cypress/e2e/1_cluster-welcome.cy.js index c0de0e546..e37c8ac24 100644 --- a/cypress/e2e/1_cluster-welcome.cy.js +++ b/cypress/e2e/1_cluster-welcome.cy.js @@ -18,7 +18,7 @@ describe('Welcome page', () => { cy.contains('Running'); // cluster status cy.contains('Cluster rebalancing on'); // rebalancing status cy.contains('Tracing is enabled'); // tracing status - cy.contains('15 Caches'); + cy.contains('16 Caches'); cy.contains('10 Counters'); cy.contains('1 Tasks'); cy.contains('13 Schemas'); diff --git a/cypress/e2e/1_data-container.cy.js b/cypress/e2e/1_data-container.cy.js index 40097e594..be3e39c40 100644 --- a/cypress/e2e/1_data-container.cy.js +++ b/cypress/e2e/1_data-container.cy.js @@ -1,5 +1,5 @@ describe('Data Container Overview', () => { - const numberOfCaches = 15; + const numberOfCaches = 16; beforeEach(() => { cy.login(Cypress.env('username'), Cypress.env('password')); @@ -172,12 +172,12 @@ describe('Data Container Overview', () => { cy.get('[data-cy=cacheFilterSelect]').click(); //Verifying that only distributed caches are shown - cy.contains('1 - 10 of 12'); + cy.contains('1 - 10 of 13'); cy.contains('java-serialized-cache'); cy.get('[data-cy=cachesTable] tr').should('have.length', 11); //11 including header row //Navigating to the next page to see the rest of the caches cy.get('[data-action=next]').first().click(); - cy.get('[data-cy=cachesTable] tr').should('have.length', 3); //3 including header row + cy.get('[data-cy=cachesTable] tr').should('have.length', 4); //3 including header row cy.contains('xml-cache'); cy.contains('java-serialized-cache').should('not.exist'); @@ -186,8 +186,8 @@ describe('Data Container Overview', () => { cy.get('[data-action=per-page-20]').click(); cy.contains('not-encoded'); cy.contains('xml-cache'); - cy.contains('1 - 12 of 12'); - cy.get('[data-cy=cachesTable] tr').should('have.length', 13); //13 including header row + cy.contains('1 - 13 of 13'); + cy.get('[data-cy=cachesTable] tr').should('have.length', 14); //13 including header row //Verifying that all entries are distributed caches cy.get('[data-cy^=type-]').each((badge) => { @@ -288,6 +288,17 @@ describe('Data Container Overview', () => { cy.wrap(badge).contains(/Bounded/); }); cy.contains('heap-test'); + + //Clearing all filters and setting Backups + cy.get('button:contains("Clear all filters"):visible').click(); + cy.get('[data-cy=cacheFilterSelectExpanded] div > button').click(); + cy.get('[data-cy="backupsFeature"]').find('input:checkbox').click(); //Filtering secured caches + cy.get('[data-cy=cacheFilterSelectExpanded] div > button').click(); //Closing filter selectbox + cy.get('[data-cy=cachesTable] tr').should('have.length', 2); //2 including header row - nothing is changed + cy.get('[data-cy^=feature-]').each((badge) => { + cy.wrap(badge).contains(/Backups/); + }); + cy.contains('xsiteCache'); }); // Displays templates page diff --git a/cypress/e2e/4_xsite.cy.js b/cypress/e2e/4_xsite.cy.js new file mode 100644 index 000000000..08b013738 --- /dev/null +++ b/cypress/e2e/4_xsite.cy.js @@ -0,0 +1,298 @@ +describe('XSite Config Tests', () => { + beforeEach(() => { + cy.login(Cypress.env('username'), Cypress.env('password')); + }); + + it('successfully creates cache with backup', () => { + cy.get('[data-cy=localSite]').should('exist'); + cy.contains("LON"); + + //Going to create cache page + cy.get('[data-cy=createCacheButton]').click(); + cy.get('#cache-name').click(); + cy.get('#cache-name').type('xsite-cache'); + cy.get('#configure').click(); + cy.get('[data-cy=wizardNextButton]').click(); + cy.get('#sync').click(); + cy.get('[data-cy=wizardNextButton]').click(); + + //Filling backup cache properties + cy.get('[data-cy=menu-toogle-featuresSelect]').click(); + cy.get('[data-cy=option-typeahead-BACKUPS]').click(); + + cy.contains("Backups for LON"); + cy.get('[data-cy="menu-toogle-sitesSelector"]').click(); + cy.get('#nyc').click(); + cy.get("#sync-0").click(); + cy.get("#backupfor").click({force: true}); + cy.get("[data-cy=remote-cache-input]").type("xsite-backup"); + cy.get('[data-cy=toggle-remoteSiteSelector]').click(); + cy.get("#option-nyc").click(); + cy.get('[data-cy=wizardNextButton]').click(); + cy.contains("Adjust settings for cache backups"); + //Filling backup cache tuning properties + cy.get("[data-cy=merge-policy-input]").type("DEFAULT"); + cy.get("[data-cy=maxCleanupDelay]").type("3000"); + cy.get("[data-cy=tombstone-map-size-input]").type("5120"); + cy.get("[id^=form-field-group-toggle]").click(); + cy.get("#twoPhaseCommit").click({force: true}); + cy.get("[data-cy=toggle-failurePolicy]").click(); + cy.get('[data-cy=option-WARN]').click(); + cy.get("[data-cy=timeout]").type(10000); + cy.get('[data-cy="afterFailuresInput"]').type(10); + cy.get('[data-cy="minwait"]').type(50000); + cy.get('[data-cy="manual-radio"]').click(); + cy.get('[data-cy="chunckSizeInput"]').type(256); + cy.get('[data-cy="timeoutStateTransfer"]').type(60000); + cy.get('[data-cy="maxRetriesInput"]').type(25); + cy.get('[data-cy="waitTime"]').type(1000); + cy.get('[data-cy=wizardNextButton]').click(); + cy.get('[data-cy=wizardNextButton]').click(); //Saving the cache + cy.get('[data-action=next]').first().click(); + cy.get('[data-cy="detailButton-xsite-cache"]').click(); + cy.contains('The cache is empty'); + cy.get('[data-cy="detailCacheActions"]').click(); + cy.get("[data-cy=manageBackupsLink]").click(); + cy.contains('Take offline'); + cy.origin('http://localhost:31222/console/', () => { + cy.visit("/", { + headers: { + 'Accept-Encoding': 'gzip, deflate, br' + }, + auth: { + username: Cypress.env('username'), + password: Cypress.env('password') + } + }); + cy.get('#nav-toggle').click(); + cy.contains("NYC"); + cy.contains("xsiteCache"); + //Going to create cache page + cy.get('[data-cy=createCacheButton]').click(); + cy.get('#cache-name').click(); + cy.get('#cache-name').type('xsite-backup'); + cy.get('#configure').click(); + cy.get('[data-cy=wizardNextButton]').click(); + cy.get('#async').click(); + cy.get('[data-cy=wizardNextButton]').click(); + + //Filling backup cache properties + cy.get('[data-cy=menu-toogle-featuresSelect]').click(); + cy.get('[data-cy=option-typeahead-BACKUPS]').click(); + cy.contains("Backups for NYC"); + cy.get('[data-cy="menu-toogle-sitesSelector"]').click(); + cy.get('#lon').click(); + cy.get("#async-0").click(); + cy.get('[data-cy=wizardNextButton]').click(); + cy.get('[data-cy=wizardNextButton]').click(); + cy.get('[data-cy=wizardNextButton]').click(); //Saving cache + cy.get('[data-cy="detailButton-xsite-backup"]').click(); + cy.contains("Backups"); + cy.get('[data-cy="detailCacheActions"]').click(); + cy.get("[data-cy=manageBackupsLink]").click(); + cy.contains("Backups management"); + cy.contains("LON"); + cy.contains("Take offline"); + //Going back to cache details page + cy.get("[data-cy=backButton]").click(); + + //Adding new entry + cy.get('[data-cy=addEntryButton]').click(); + cy.get('#key-entry').click().type('key1'); + cy.get('#value-entry').click().type('value1'); + cy.get('[data-cy=addButton]').click(); + cy.contains('Entry added to cache xsite-backup.'); + cy.contains('key1'); + cy.contains('value1'); + }) + }); + + it('successfully shows the site name on data container page', () => { + cy.contains("LON"); + //Going to next page for checking xsite caches. + cy.get('[data-action=next]').first().click(); + cy.contains("xsiteCache"); + cy.contains("xsite-cache"); + + //Verifying that entries entered in previous test were successfully synced + cy.get('[data-cy="detailButton-xsite-cache"]').click(); + cy.contains('key1'); + cy.contains('value1'); + + cy.get("#nav-toggle").click(); + cy.contains("Cluster Membership").click(); + cy.contains("1 member in use"); + + cy.origin('http://localhost:31222/console/', () => { + cy.visit("/", { + headers: { + 'Accept-Encoding': 'gzip, deflate, br' + }, + auth: { + username: Cypress.env('username'), + password: Cypress.env('password') + } + }); + cy.get('#nav-toggle').click(); + cy.contains("NYC"); + cy.contains("xsiteCache"); + cy.contains("xsite-backup"); + cy.get("#nav-toggle").click(); + cy.contains("Cluster Membership").click(); + cy.contains("1 member in use"); + }) + }); + + it('successfully views the Manage Backup pages.', () => { + cy.contains("LON"); + //Going to next page for checking xsite caches. + cy.get('[data-action=next]').first().click(); + cy.contains("xsiteCache").click(); + cy.contains("Backups"); + cy.contains('1 - 5 of 5'); + cy.get('[data-cy="detailCacheActions"]').click(); + cy.get("[data-cy=manageBackupsLink]").click(); + cy.contains("Backups management"); + cy.contains("NYC"); + cy.contains("Take offline"); + cy.get("[data-cy=NYC-startTransfer]").should("exist"); + + cy.origin('http://localhost:31222/console/', () => { + cy.visit("/", { + headers: { + 'Accept-Encoding': 'gzip, deflate, br' + }, + auth: { + username: Cypress.env('username'), + password: Cypress.env('password') + } + }); + cy.get('#nav-toggle').click(); + cy.contains("NYC"); + cy.contains("xsiteCache").click(); + cy.contains('1 - 5 of 5'); + cy.contains("Backups").should('not.exist'); + cy.get('[data-cy="detailCacheActions"]').click(); + cy.get("[data-cy=manageBackupsLink]").should('not.exist'); + }) + }); + + it('successfully takes offline the backup, adds/deletes/updates data and verifies that backup doesn\'t contain all changes', () => { + cy.contains("LON"); + //Going to next page for checking xsite caches. + cy.get('[data-action=next]').first().click(); + cy.contains("xsiteCache").click(); + //Going to manage Backups page and taking the backup site offline + cy.get('[data-cy="detailCacheActions"]').click(); + cy.get("[data-cy=manageBackupsLink]").click(); + cy.contains("Take offline"); + cy.get("#NYC-switch").click({force: true}); + cy.contains("Operation take offline on site NYC has started."); + cy.contains("Bring online"); + + //Going back to cache details page + cy.get("[data-cy=backButton]").click(); + + //Editing entry + cy.get('[data-cy=actions-key3]').click(); + cy.get('[aria-label=editEntryAction]').click(); + cy.get("#value-entry").type("1"); + cy.get("[data-cy=addButton]").click(); + cy.contains("value31"); + + //Deleting entry + cy.get("[data-cy=actions-key5]").click(); + cy.get('[aria-label=deleteEntryAction]').click(); + cy.get('[data-cy=deleteEntryButton]').click(); + + //Adding new entry + cy.get('[data-cy=addEntryButton]').click(); + cy.get('#key-entry').click().type('stringKey'); + cy.get('#value-entry').click().type('stringValue'); + cy.get('[data-cy=addButton]').click(); + cy.contains('Entry added to cache xsiteCache.'); + cy.get('.pf-v5-c-alert__action > .pf-v5-c-button').click(); //Closing alert popup. + cy.contains('stringKey'); + cy.contains('stringValue'); + + //Verifying that as the backup site is taken offline neither of the changes is visible on the backup site. + cy.origin('http://localhost:31222/console/', () => { + cy.visit("/", { + headers: { + 'Accept-Encoding': 'gzip, deflate, br' + }, + auth: { + username: Cypress.env('username'), + password: Cypress.env('password') + } + }); + cy.get('#nav-toggle').click(); + cy.contains("NYC"); + cy.contains("xsiteCache").click(); + cy.contains('1 - 5 of 5'); + cy.contains("stringKey").should("not.exist"); + cy.contains("key5"); + cy.contains("value31").should("not.exist"); + }); + }); + + it('successfully brings online the backup, performs the state transfer and verifies that changes appeared on backup site', () => { + cy.contains("LON"); + //Going to next page for checking xsite caches. + cy.get('[data-action=next]').first().click(); + cy.contains("xsiteCache").click(); + //Going to manage Backups page and bringing the backup site online + cy.get('[data-cy="detailCacheActions"]').click(); + cy.get("[data-cy=manageBackupsLink]").click(); + cy.contains("Bring online"); + cy.get("#NYC-switch").click({force: true}); + cy.contains("Operation bring online on site NYC has started."); + cy.contains("Take offline"); + + //Starting state transfer + cy.get("[data-cy=NYC-startTransfer]").click(); + cy.contains("Are you sure you want to start a state transfer?"); + cy.get("[data-cy=startTransferButton]").click(); + cy.contains("Operation state transfer on site NYC has started."); + cy.contains("Transfer Ok"); + cy.contains("Clear state"); //NYC-clearStateButton + + //Verifying that as the backup site is taken offline neither of the changes is visible on the backup site. + cy.origin('http://localhost:31222/console/', () => { + cy.visit("/", { + headers: { + 'Accept-Encoding': 'gzip, deflate, br' + }, + auth: { + username: Cypress.env('username'), + password: Cypress.env('password') + } + }); + cy.get('#nav-toggle').click(); + cy.contains("NYC"); + cy.contains("xsiteCache").click(); + cy.contains('1 - 6 of 6'); + cy.contains("stringKey"); + cy.contains("key5"); //The key5 should still be there as the state transfer doesn't include the entry deletions; + cy.contains("value31"); + }); + }); + + it('successfully clears state', () => { + cy.contains("LON"); + //Going to next page for checking xsite caches. + cy.get('[data-action=next]').first().click(); + cy.contains("xsiteCache").click(); + //Going to manage Backups page and bringing the backup site online + cy.get('[data-cy="detailCacheActions"]').click(); + cy.get("[data-cy=manageBackupsLink]").click(); + cy.contains("Take offline"); + cy.contains("Transfer Ok"); + cy.get("[data-cy=NYC-clearStateButton]").click(); + cy.contains("Operation clear state transfer state on site NYC has started."); + cy.contains("Transfer Ok").should("not.exist"); + cy.contains("Clear state").should("not.exist"); + cy.contains("Start transfer"); + }); +}); + diff --git a/data/caches/xsiteLON.json b/data/caches/xsiteLON.json new file mode 100644 index 000000000..b259fb58d --- /dev/null +++ b/data/caches/xsiteLON.json @@ -0,0 +1,17 @@ +{ + "distributed-cache": { + "mode": "SYNC", + "statistics": true, + "encoding": { + "media-type": "application/x-protostream" + }, + "backups": { + "NYC" : { + "backup" : { + "strategy" : "SYNC", + "failure-policy": "WARN" + } + } + } + } +} diff --git a/data/caches/xsiteNYC.json b/data/caches/xsiteNYC.json new file mode 100644 index 000000000..dbc83b143 --- /dev/null +++ b/data/caches/xsiteNYC.json @@ -0,0 +1,9 @@ +{ + "distributed-cache": { + "mode": "SYNC", + "statistics": true, + "encoding": { + "media-type": "application/x-protostream" + } + } +} diff --git a/data/create-data.sh b/data/create-data.sh index 10c07042b..5188ab877 100755 --- a/data/create-data.sh +++ b/data/create-data.sh @@ -14,6 +14,8 @@ curl -XDELETE --digest -u $userPass http://localhost:11222/rest/v2/caches/indexe curl -XDELETE --digest -u $userPass http://localhost:11222/rest/v2/caches/octet-stream-cache curl -XDELETE --digest -u $userPass http://localhost:11222/rest/v2/caches/java-serialized-cache curl -XDELETE --digest -u $userPass http://localhost:11222/rest/v2/caches/invalidation-cache +curl -XDELETE --digest -u $userPass http://localhost:11222/rest/v2/caches/xsiteCache +curl -XDELETE --digest -u $userPass http://localhost:31222/rest/v2/caches/xsiteCache echo "= Create schema" @@ -39,6 +41,9 @@ curl -XPOST --digest -u $userPass -H "Content-Type: application/json" -d "@cache curl -XPOST --digest -u $userPass -H "Content-Type: application/json" -d "@caches/octet-stream.json" "http://localhost:11222/rest/v2/caches/octet-stream-cache" curl -XPOST --digest -u $userPass -H "Content-Type: application/json" -d "@caches/javaSerializedCache.json" "http://localhost:11222/rest/v2/caches/java-serialized-cache" # curl -XPOST -u $userPass -H "Content-Type: application/json" -d "@caches/invalidationCache.json" "http://localhost:11222/rest/v2/caches/invalidation-cache" +echo "= Create X-Site Cache" +curl -XPOST --digest -u $userPass -H "Content-Type: application/json" -d "@caches/xsiteLON.json" http://localhost:11222/rest/v2/caches/xsiteCache +curl -XPOST --digest -u $userPass -H "Content-Type: application/json" -d "@caches/xsiteNYC.json" http://localhost:31222/rest/v2/caches/xsiteCache for i in {1..10} @@ -55,7 +60,17 @@ curl -XPOST --digest -u $userPass -H "Key-Content-Type: application/x-java-objec curl -XPOST --digest -u $userPass -H "Key-Content-Type: application/x-java-object;type=java.lang.Double" -H "Content-Type: application/x-java-object;type=java.lang.String" -d double http://localhost:11222/rest/v2/caches/java-cache/123.909 curl -XPOST --digest -u $userPass -H "Key-Content-Type: application/x-java-object;type=java.lang.Float" -H "Content-Type: application/x-java-object;type=java.lang.String" -d float http://localhost:11222/rest/v2/caches/java-cache/12.87 -#Jboss data +#XSite data +echo "= Put 5 entries in XSite cache" +for i in {1..5} +do + URL='http://localhost:11222/rest/v2/caches/xsiteCache/key'$i + DATA='{ + "_type": "string", + "_value": "value'$i'" + }' + curl -XPOST --digest -u $userPass -d "$DATA" -H 'Content-Type: application/json' $URL +done echo "= Delete counters" diff --git a/run-server-for-e2e-container.sh b/run-server-for-e2e-container.sh index 6b59a34c9..f5aa82a84 100755 --- a/run-server-for-e2e-container.sh +++ b/run-server-for-e2e-container.sh @@ -6,14 +6,22 @@ echo ${ABSOLUTE_PATH} SERVER_IMAGE_URL="${SERVER_IMAGE_URL:-quay.io/infinispan-test/server:main}" docker pull ${SERVER_IMAGE_URL} -docker run -d -p 11222:11222 -v ${ABSOLUTE_PATH}/scripts/identities.batch:/user-config/identities.batch -v ${ABSOLUTE_PATH}/dist:/opt/infinispan/static/console -v ${ABSOLUTE_PATH}/scripts/infinispan-basic-auth.xml:/opt/infinispan/server/conf/infinispan.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m" -e IDENTITIES_BATCH="/user-config/identities.batch" ${SERVER_IMAGE_URL} --node-name=infinispan-4-e2e -docker exec $(docker ps -q -l) /opt/infinispan/bin/cli.sh install org.openjdk.nashorn:nashorn-core:15.4 -docker exec $(docker ps -q -l) /opt/infinispan/bin/cli.sh install org.ow2.asm:asm:9.4 -docker exec $(docker ps -q -l) /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-commons:9.4 -docker exec $(docker ps -q -l) /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-tree:9.4 -docker exec $(docker ps -q -l) /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-util:9.4 +docker run --name ispn-lon -d -p 11222:11222 -v ${ABSOLUTE_PATH}/scripts/identities.batch:/user-config/identities.batch -v ${ABSOLUTE_PATH}/dist:/opt/infinispan/static/console -v ${ABSOLUTE_PATH}/scripts/infinispan-basic-auth.xml:/opt/infinispan/server/conf/infinispan.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" ${SERVER_IMAGE_URL} --node-name=infinispan-4-e2e +docker run --name ispn-nyc -d -p 31222:11222 -v ${ABSOLUTE_PATH}/scripts/identities.batch:/user-config/identities.batch -v ${ABSOLUTE_PATH}/dist:/opt/infinispan/static/console -v ${ABSOLUTE_PATH}/scripts/infinispan-basic-auth.xml:/opt/infinispan/server/conf/infinispan.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" ${SERVER_IMAGE_URL} --node-name=infinispan-4-e2e -docker restart $(docker ps -q -l) +#Adding nashorn libraries to both containers +for containerId in $(docker ps -q) +do + docker exec -it $containerId /opt/infinispan/bin/cli.sh install org.openjdk.nashorn:nashorn-core:15.4 + docker exec -it $containerId /opt/infinispan/bin/cli.sh install org.ow2.asm:asm:9.4 + docker exec -it $containerId /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-commons:9.4 + docker exec -it $containerId /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-tree:9.4 + docker exec -it $containerId /opt/infinispan/bin/cli.sh install org.ow2.asm:asm-util:9.4 +done + +#Restarting containers +docker restart $(docker ps -q) sleep 20 +#Creating data cd data; bash ./create-data.sh admin password diff --git a/scripts/infinispan-basic-auth.xml b/scripts/infinispan-basic-auth.xml index a6a518490..6d1547bd5 100644 --- a/scripts/infinispan-basic-auth.xml +++ b/scripts/infinispan-basic-auth.xml @@ -1,12 +1,43 @@ + + + + + + + + + + + + + + - + { value={mergePolicy} onChange={(_event, val) => setMergePolicy(val === '' ? undefined! : val)} aria-label="merge-policy-input" + data-cy="merge-policy-input" /> @@ -117,6 +118,7 @@ const BackupsConfigurationTuning = () => { setTombstoneMapSize(isNaN(parsedVal) ? undefined! : parsedVal); }} aria-label="tombstone-map-size-input" + data-cy="tombstone-map-size-input" /> @@ -134,7 +136,7 @@ const BackupsConfigurationTuning = () => { {configuration.feature.backupsCache && configuration.feature.backupsCache.sites.map((site, index) => { return ( - } > diff --git a/src/app/Caches/Create/AdvancedTuning/BackupsSiteConfigurator.tsx b/src/app/Caches/Create/AdvancedTuning/BackupsSiteConfigurator.tsx index c9586ee8f..e2e1554ff 100644 --- a/src/app/Caches/Create/AdvancedTuning/BackupsSiteConfigurator.tsx +++ b/src/app/Caches/Create/AdvancedTuning/BackupsSiteConfigurator.tsx @@ -107,11 +107,11 @@ const BackupSiteConfigurator = (props: { @@ -121,6 +121,7 @@ const BackupSiteConfigurator = (props: { placeholder="0" type="number" id="afterFailures" + data-cy="afterFailuresInput" value={afterFailures} onChange={(e, val) => { const value = parseInt(val); @@ -179,6 +180,7 @@ const BackupSiteConfigurator = (props: { setMode(BackupSiteStateTransferMode.MANUAL)} isChecked={(mode as BackupSiteStateTransferMode) == BackupSiteStateTransferMode.MANUAL} label={t('caches.create.configurations.feature.mode-manual')} @@ -186,6 +188,7 @@ const BackupSiteConfigurator = (props: { setMode(BackupSiteStateTransferMode.AUTO)} isChecked={(mode as BackupSiteStateTransferMode) == BackupSiteStateTransferMode.AUTO} label={t('caches.create.configurations.feature.mode-auto')} @@ -208,6 +211,7 @@ const BackupSiteConfigurator = (props: { placeholder="512" type="number" id="chuncksize" + data-cy="chunckSizeInput" value={chunckSize} onChange={(e, val) => { const value = parseInt(val); @@ -254,6 +258,7 @@ const BackupSiteConfigurator = (props: { placeholder="30" type="number" id="maxretries" + data-cy="maxRetriesInput" value={maxRetries} onChange={(e, val) => { const value = parseInt(val); @@ -333,6 +338,7 @@ const BackupSiteConfigurator = (props: { selected={failurePolicy!} options={selectOptionProps(BackupSiteFailurePolicy)} onSelect={(value) => setFailurePolicy(value)} + toggleId='failurePolicySelector' /> { options={selectOptionPropsFromArray(availableSites)} onSelect={helperAddSite} onClear={clearSelection} + toggleId="backup-selector" create={true} selection={sites.some((s) => s.siteName !== undefined) ? sites.map((s) => s.siteName as string) : []} /> @@ -221,6 +222,7 @@ const BackupsCacheConfigurator = (props: { isEnabled: boolean }) => { validateBackupsForField(trimmedVal); }} aria-label="remote-cache-input" + data-cy="remote-cache-input" /> { onSelect={(selection) => setRemoteSite(selection)} selected={remoteSite} isFullWidth={true} + toggleId='remote-site-selector' /> {validateBackupsForField(remoteSite) === 'error' && ( diff --git a/src/app/XSite/StateTransfer.tsx b/src/app/XSite/StateTransfer.tsx index b5c3a6780..779fece03 100644 --- a/src/app/XSite/StateTransfer.tsx +++ b/src/app/XSite/StateTransfer.tsx @@ -47,10 +47,11 @@ const StateTransfer = (props: { key="state-transfer-button" onClick={() => props.closeModal(true)} variant={props.action == 'start' ? ButtonVariant.primary : ButtonVariant.danger} + data-cy={props.action == 'start' ? 'startTransferButton' : 'cancelStateTransferButton'} > {props.action == 'start' ? 'Start transfer' : 'Cancel transfer'} , - ]} diff --git a/src/app/XSite/XSiteCache.tsx b/src/app/XSite/XSiteCache.tsx index 7382fe38c..5024cf8be 100644 --- a/src/app/XSite/XSiteCache.tsx +++ b/src/app/XSite/XSiteCache.tsx @@ -205,7 +205,7 @@ const XSiteCache = (props) => { if (stStatus == ST_SENDING) { return ( - ); } return ( -