Skip to content

Commit

Permalink
Added tests from xsite testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
andyuk1986 authored and karesti committed Nov 4, 2024
1 parent a8cf3f3 commit 48848d0
Show file tree
Hide file tree
Showing 15 changed files with 450 additions and 41 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,31 @@ jobs:
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
- if: github.base_ref == '15.0' || github.ref_name == '15.0'
name: Start Infinispan Server 15.0 Version
name: Start 2 Cross-site Infinispan Servers 15.0 Version
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:15.0.x --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:15.0.x --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:15.0.x --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
#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
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
#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
- name: Restarting Infinispan Server After Nashorn Installation
run: |
docker restart $(docker ps -q -l)
docker restart $(docker ps -q)
# 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
- name: Initialize Infinispan Server
run: cd data; bash ./create-data.sh admin password
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/1_cluster-welcome.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Welcome page', () => {
cy.contains('Data container');
cy.contains('Running'); // cluster status
cy.contains('Cluster rebalancing on'); // rebalancing status
cy.contains('15 Caches');
cy.contains('16 Caches');
cy.contains('10 Counters');
cy.contains('1 Tasks');
cy.contains('13 Schemas');
Expand Down
21 changes: 16 additions & 5 deletions cypress/e2e/1_data-container.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Data Container Overview', () => {
const numberOfCaches = 15;
const numberOfCaches = 16;

beforeEach(() => {
cy.login(Cypress.env('username'), Cypress.env('password'));
Expand Down Expand Up @@ -171,12 +171,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');

Expand All @@ -185,8 +185,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) => {
Expand Down Expand Up @@ -287,6 +287,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
Expand Down
7 changes: 5 additions & 2 deletions cypress/e2e/3_counters.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,14 @@ describe('Counters CRUD', () => {
.within($tr => {
cy.get('td button').should('exist');
cy.get('td button').click();
//Adding some sleeps for avoiding random failing test scenario
cy.wait(3000);
cy.get('[aria-label=deleteCounter]').click();
cy.wait(3000);
});

cy.wait(3000);
cy.get("[data-cy=deleteCounterButton]").click();

cy.wait(3000);
cy.get("#delete-counter-modal").should('not.exist');
cy.contains("Counter strong-5 has been deleted.");
cy.get("[aria-label='counters-table-label']").contains("td", "strong-5").should("not.exist");
Expand Down
Loading

0 comments on commit 48848d0

Please sign in to comment.