Skip to content

Commit

Permalink
Merge branch 'master' into API-1740
Browse files Browse the repository at this point in the history
  • Loading branch information
harunalpak committed Dec 14, 2022
2 parents a399ee6 + 0f4a528 commit 0210e66
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 64 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/coverage_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 8

- name: Setup Node.js
uses: actions/setup-node@v2
with:
Expand All @@ -66,6 +65,17 @@ jobs:
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.inputs.pr_number }}/merge

- name: Checkout to test artifacts
uses: actions/checkout@v2
with:
repository: hazelcast/private-test-artifacts
path: certs
ref: data
token: ${{ secrets.GH_TOKEN }}
- name: Copy certificates JAR to destination with the appropriate name
run: |
cp ${{ github.workspace }}/certs/certs.jar ${{ github.workspace }}/certs.jar
- name: Install dependencies and compile client
run: |
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/nightly_runner_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ jobs:
node-version: ${{ matrix.nodejs_version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout to test artifacts
uses: actions/checkout@v2
with:
repository: hazelcast/private-test-artifacts
path: certs
ref: data
token: ${{ secrets.GH_TOKEN }}
- name: Copy certificates JAR to destination with the appropriate name
run: |
cp ${{ github.workspace }}/certs/certs.jar ${{ github.workspace }}/certs.jar
- name: Install dependencies and compile client
run: |
npm install
Expand Down
8 changes: 3 additions & 5 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -719,12 +719,10 @@ Or, if you want to use your own serialization method, you can use [Custom Serial
## 4.1. Compact Serialization

> **WARNING: This serialization method is in Beta, and API can be changed in a breaking way.**
> **NOTES: Supported in client version 5.1+ and server version 5.0+. However, it is recommended to use 5.1+ client with a 5.1+
server.

> **WARNING: Supported in client version 5.1+ and server version 5.0+. However, it is recommended to use 5.1+ client with a 5.1+
server because compatiblity is not guaranteed as compact is in Beta.**

As an enhancement to existing serialization methods, Hazelcast offers a beta version of the compact serialization, with the
As an enhancement to existing serialization methods, Hazelcast offers the compact serialization, with the
following main features.

* Separates the schema from the data and stores it per type, not per object which results in less memory and bandwidth usage
Expand Down
29 changes: 0 additions & 29 deletions scripts/download-rc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const HZ_TEST_VERSION = '5.2.2-SNAPSHOT';
const HAZELCAST_TEST_VERSION = HZ_TEST_VERSION;
const HAZELCAST_VERSION = HZ_VERSION;
const HAZELCAST_ENTERPRISE_VERSION = HZ_VERSION;
const HAZELCAST_ENTERPRISE_TEST_VERSION = HZ_VERSION;
const HAZELCAST_RC_VERSION = '0.8-SNAPSHOT';
const SNAPSHOT_REPO = 'https://oss.sonatype.org/content/repositories/snapshots';
const RELEASE_REPO = 'http://repo1.maven.apache.org/maven2';
Expand All @@ -22,7 +21,6 @@ const downloadRC = () => {
let REPO;
let ENTERPRISE_REPO;
let TEST_REPO;
// let ENTERPRISE_TEST_REPO;

if (HZ_VERSION.endsWith('-SNAPSHOT')) {
REPO = SNAPSHOT_REPO;
Expand All @@ -34,10 +32,8 @@ const downloadRC = () => {

if (HZ_TEST_VERSION.endsWith('-SNAPSHOT')) {
TEST_REPO = SNAPSHOT_REPO;
// ENTERPRISE_TEST_REPO = ENTERPRISE_SNAPSHOT_REPO;
} else {
TEST_REPO = RELEASE_REPO;
// ENTERPRISE_TEST_REPO = ENTERPRISE_RELEASE_REPO;
}

if (fs.existsSync(`hazelcast-remote-controller-${HAZELCAST_RC_VERSION}.jar`)) {
Expand Down Expand Up @@ -132,30 +128,6 @@ const downloadRC = () => {
+ `com.hazelcast:hazelcast-enterprise:${HAZELCAST_ENTERPRISE_VERSION} ${subprocessTrace}`;
}
}
// TODO hazelcast-enterprise-tests.jar was removed from repo.
/*
if (fs.existsSync(`hazelcast-enterprise-${HAZELCAST_TEST_VERSION}-tests.jar`)) {
console.log('hazelcast-enterprise-tests.jar already exists, not downloading from maven.');
} else {
console.log('Downloading: hazelcast enterprise test jar '
+ `com.hazelcast:hazelcast-enterprise:${HAZELCAST_TEST_VERSION}:jar:tests`);
const subprocess = spawnSync('mvn', [
'-q',
'org.apache.maven.plugins:maven-dependency-plugin:2.8:get',
'-Dtransitive=false',
`-DrepoUrl=${ENTERPRISE_TEST_REPO}`,
`-Dartifact=com.hazelcast:hazelcast-enterprise:${HAZELCAST_TEST_VERSION}:jar:tests`,
`-Ddest=hazelcast-enterprise-${HAZELCAST_TEST_VERSION}-tests.jar`
], {
stdio: 'inherit',
shell: ON_WINDOWS
});
if (subprocess.status !== 0) {
const subprocessTrace = subprocess.error ? subprocess.error.stack : '';
throw 'Failed to download hazelcast enterprise test jar '
+ `com.hazelcast:hazelcast-enterprise:${HAZELCAST_TEST_VERSION}:jar:tests ${subprocessTrace}`;
}
}*/
console.log('Starting Remote Controller ... enterprise ...');
} else {
if (fs.existsSync(`hazelcast-${HAZELCAST_VERSION}.jar`)) {
Expand Down Expand Up @@ -185,7 +157,6 @@ module.exports = {
HAZELCAST_VERSION: HAZELCAST_VERSION,
HAZELCAST_TEST_VERSION: HAZELCAST_TEST_VERSION,
HAZELCAST_ENTERPRISE_VERSION: HAZELCAST_ENTERPRISE_VERSION,
HAZELCAST_ENTERPRISE_TEST_VERSION: HAZELCAST_ENTERPRISE_TEST_VERSION,
HAZELCAST_RC_VERSION: HAZELCAST_RC_VERSION,
downloadRC: downloadRC
};
3 changes: 1 addition & 2 deletions scripts/test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const {
HAZELCAST_RC_VERSION,
HAZELCAST_TEST_VERSION,
HAZELCAST_ENTERPRISE_VERSION,
HAZELCAST_ENTERPRISE_TEST_VERSION,
HAZELCAST_VERSION,
downloadRC
} = require('./download-rc.js');
Expand Down Expand Up @@ -40,7 +39,7 @@ let CLASSPATH = `hazelcast-remote-controller-${HAZELCAST_RC_VERSION}.jar${PATH_S

if (HAZELCAST_ENTERPRISE_KEY) {
CLASSPATH = `hazelcast-enterprise-${HAZELCAST_ENTERPRISE_VERSION}.jar${PATH_SEPARATOR}`
+ `hazelcast-enterprise-${HAZELCAST_ENTERPRISE_TEST_VERSION}-tests.jar${PATH_SEPARATOR}`
+ `certs.jar${PATH_SEPARATOR}`
+ CLASSPATH;
} else {
CLASSPATH = `hazelcast-${HAZELCAST_VERSION}.jar${PATH_SEPARATOR}${CLASSPATH}`;
Expand Down
11 changes: 11 additions & 0 deletions test/TestUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,17 @@ exports.compareServerVersionWithRC = async function (rc, version) {
return rcServerVersion - comparedVersion;
};

exports.isCompactCompatible = async function () {
const comparisonValueForServerVersion520 = await exports.compareServerVersionWithRC(RC, '5.2.0');
const isClientVersionAtLeast520 = exports.isClientVersionAtLeast('5.2.0');
// Compact serialization 5.2 and newer server is not compatible with clients older than 5.2
// Compact serialization 5.2 and newer clients are not compatible with servers older than 5.2
const isCompactCompatible =
!((comparisonValueForServerVersion520 >= 0 && !isClientVersionAtLeast520) ||
(comparisonValueForServerVersion520 < 0 && isClientVersionAtLeast520));
return isCompactCompatible;
};

exports.isClientVersionAtLeast = function(version) {
const actual = exports.calculateServerVersionFromString(BuildInfo.getClientVersion());
const expected = exports.calculateServerVersionFromString(version);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ describe('NearCachedMapTest', function () {

before(async function () {
TestUtil.markClientVersionAtLeast(this, '5.1');
const isCompactCompatible = await TestUtil.isCompactCompatible();
if (!isCompactCompatible) {
this.skip();
}
cluster = await testFactory.createClusterForParallelTests();
member = await RC.startMember(cluster.id);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,18 @@ describe('CompactPublicAPIsTest', function () {

before(async function () {
TestUtil.markClientVersionAtLeast(this, '5.1.0');
employee = new CompactUtil.Employee(1, Long.ONE);
if ((await TestUtil.compareServerVersionWithRC(RC, '5.1.0')) < 0) {
const comparisonValueForServerVersion520 = await TestUtil.compareServerVersionWithRC(RC, '5.2.0');
const isCompactCompatible = await TestUtil.isCompactCompatible();
if (!isCompactCompatible) {
skipped = true;
this.skip();
}
// Compact serialization 5.2 server is not compatible with clients older than 5.2
if ((await TestUtil.compareServerVersionWithRC(RC, '5.2.0')) >= 0 && !TestUtil.isClientVersionAtLeast('5.2.0')) {
employee = new CompactUtil.Employee(1, Long.ONE);
if ((await TestUtil.compareServerVersionWithRC(RC, '5.1.0')) < 0) {
skipped = true;
this.skip();
}
if ((await TestUtil.compareServerVersionWithRC(RC, '5.2.0')) < 0) {
if (comparisonValueForServerVersion520 < 0) {
CLUSTER_CONFIG_XML = CLUSTER_CONFIG_XML
.replace('<compact-serialization/>', '<compact-serialization enabled="true"/>');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ describe('CompactSerializersLiveTest', function () {
before(async function () {
TestUtil.markClientVersionAtLeast(this, '5.1.0');
const comparisonValueForServerVersion520 = await TestUtil.compareServerVersionWithRC(RC, '5.2.0');
if ((await TestUtil.compareServerVersionWithRC(RC, '5.1.0')) < 0) {
this.skip();
}
// Compact serialization 5.2 server is not compatible with clients older than 5.2
if (comparisonValueForServerVersion520 >= 0 && !TestUtil.isClientVersionAtLeast('5.2.0')) {
const isCompactCompatible = await TestUtil.isCompactCompatible();
if (!isCompactCompatible) {
this.skip();
}
// Compact serialization 5.2 server configuration changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,8 @@ describe('CompactTest', function () {
before(async function () {
TestUtil.markClientVersionAtLeast(this, '5.1.0');
const comparisonValueForServerVersion520 = await TestUtil.compareServerVersionWithRC(RC, '5.2.0');
if ((await TestUtil.compareServerVersionWithRC(RC, '5.1.0')) < 0) {
this.skip();
}
// Compact serialization 5.2 server is not compatible with clients older than 5.2
if (comparisonValueForServerVersion520 >= 0 && !TestUtil.isClientVersionAtLeast('5.2.0')) {
const isCompactCompatible = await TestUtil.isCompactCompatible();
if (!isCompactCompatible) {
this.skip();
}
// Compact serialization 5.2 server configuration changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ describe('PartitionServiceTest', function () {

before(async function () {
TestUtil.markClientVersionAtLeast(this, '5.1.0');
const isCompactCompatible = await TestUtil.isCompactCompatible();
if (!isCompactCompatible) {
this.skip();
}
cluster = await testFactory.createClusterForParallelTests();
member = await RC.startMember(cluster.id);
client = await testFactory.newHazelcastClientForParallelTests({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,11 @@ describe('SQLDataTypeTest', function () {
};

before(async function () {
serverVersionNewerThanFive = await TestUtil.compareServerVersionWithRC(RC, '5.0') >= 0;
const comparisonValueForServerVersion520 = await TestUtil.compareServerVersionWithRC(RC, '5.2.0');
const serverVersionNewerThanFivePointOne = await TestUtil.compareServerVersionWithRC(RC, '5.1') >= 0;
isCompactCompatible = await TestUtil.isCompactCompatible();

// If client is not newer than 5.2 and server is newer than 5.2, compact serialization is not compatible
isCompactCompatible = !(comparisonValueForServerVersion520 >= 0
&& !TestUtil.isClientVersionAtLeast('5.2.0'));
serverVersionNewerThanFive = await TestUtil.compareServerVersionWithRC(RC, '5.0') >= 0;
const serverVersionNewerThanFivePointOne = await TestUtil.compareServerVersionWithRC(RC, '5.1') >= 0;

// Compact serialization 5.2 server configuration changes
if (comparisonValueForServerVersion520 < 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const RC = require('../../../RC');
const { IllegalStateError } = require('../../../../../lib');
const TestUtil = require('../../../../TestUtil');

describe.skip('ClientSSLAuthenticationTest', function () {
describe('ClientSSLAuthenticationTest', function () {
let cluster;

const maRequiredXML = __dirname + '/hazelcast-ma-required.xml';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const RC = require('../../../RC');
const { IllegalStateError } = require('../../../../../lib');
const TestUtil = require('../../../../TestUtil');

describe.skip('ClientSSLTest', function () {
describe('ClientSSLTest', function () {
let cluster;
let client;
let serverConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,8 @@ describe('CompactRestartTest', function() {
before(async function () {
TestUtil.markClientVersionAtLeast(this, '5.1.0');
const comparisonValueForServerVersion520 = await TestUtil.compareServerVersionWithRC(RC, '5.2.0');
if ((await TestUtil.compareServerVersionWithRC(RC, '5.1.0')) < 0) {
this.skip();
}
// Compact serialization 5.2 server is not compatible with clients older than 5.2
if (comparisonValueForServerVersion520 >= 0 && !TestUtil.isClientVersionAtLeast('5.2.0')) {
const isCompactCompatible = await TestUtil.isCompactCompatible();
if (!isCompactCompatible) {
this.skip();
}
if (comparisonValueForServerVersion520 < 0) {
Expand Down

0 comments on commit 0210e66

Please sign in to comment.