Skip to content
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

Added new tests covering x-site replication cases. #540

Merged
merged 1 commit into from
Nov 4, 2024
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
28 changes: 18 additions & 10 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
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 @@ -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');
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 @@ -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');

Expand All @@ -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) => {
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading