Skip to content
Merged
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
103 changes: 88 additions & 15 deletions .github/workflows/nightly_runner_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,120 @@ jobs:
uses: ./.github/workflows/get-supported-node-versions.yml

run-tests:
runs-on: ${{ matrix.os }}
needs: node-versions
name: Run tests of master on ${{ matrix.os }} with Node ${{ matrix.nodejs_version }}
needs:
- node-versions
Comment on lines +12 to +13
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
needs:
- node-versions
needs: node-versions

nit

runs-on: ${{ matrix.os }}
permissions:
id-token: write
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
nodejs_version: ${{ fromJSON(needs.node-versions.outputs.node-versions) }}
hz_version: [ "5.6.0" ]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Read Java Config
shell: bash
run: cat .github/java-config.env >> $GITHUB_ENV

- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.nodejs_version }}
- name: Checkout to test artifacts
node-version: ${{ needs.node-versions.outputs.default-version }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ secrets.AWS_HAZELCAST_OIDC_GITHUB_ACTIONS_ROLE_ARN }}
aws-region: 'us-east-1'
Comment thread
JackPGreen marked this conversation as resolved.

- name: Get Secrets
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
HAZELCAST_ENTERPRISE_KEY,CN/HZ_LICENSE_KEY

- name: Checkout to certificates
uses: actions/checkout@v4
with:
repository: hazelcast/private-test-artifacts
path: certs
ref: data
token: ${{ secrets.GH_TOKEN }}
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
unzip -p ${{ github.workspace }}/certs.jar com/hazelcast/nio/ssl/letsencrypt.jks > test/integration/backward_compatible/parallel/ssl/keystore.jks
cp ${{ github.workspace }}/certs/certs.jar ${{ github.workspace }}/certs.jar
unzip -p ${{ github.workspace }}/certs.jar com/hazelcast/nio/ssl/letsencrypt.jks > test/integration/backward_compatible/parallel/ssl/keystore.jks

- name: Create the test jar with certificates (Linux)
if: matrix.os == 'ubuntu-latest'
working-directory: certs
run: |
zip -r -j certs.jar $GITHUB_WORKSPACE/test/integration/backward_compatible/parallel/ssl/*.pem
cp certs.jar ../hazelcast-enterprise-${{ matrix.hz_version }}-tests.jar

- name: Create the test jar with certificates (Windows)
if: matrix.os == 'windows-latest'
working-directory: certs
run: |
$compress = @{
Path = "../test/integration/backward_compatible/parallel/ssl/*.pem"
CompressionLevel = "Fastest"
DestinationPath = "certs.jar"
}
Compress-Archive -Update @compress
cp certs.jar ../hazelcast-enterprise-${{ matrix.hz_version }}-tests.jar

- name: Download RCD (Linux)
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
wget -q https://client-rcd-download.s3.us-east-2.amazonaws.com/rcd-ubuntu-latest

- name: Download RCD (Windows)
if: matrix.os == 'windows-latest'
run: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest https://client-rcd-download.s3.us-east-2.amazonaws.com/rcd-windows-latest.exe -OutFile rcd-windows-latest.exe

- name: Install dependencies and compile client
run: |
npm install
npm run compile
- name: Validate User Code
run: npm run validate-user-code
- name: Run tests

- name: Run all tests (Linux)
if: matrix.os == 'ubuntu-latest'
env:
HZ_VERSION: ${{ matrix.hz_version }}
run: |
chmod +x rcd-ubuntu-latest
./rcd-ubuntu-latest -version $HZ_VERSION -no-simple-server &
# wait for a bit for RCD to download artifacts
sleep 10
# make sure to run the coverage in the same step with RCD
npm run coverage
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move npm run coverage to a separate step as it's in both Run all tests blocks?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having it in a separate step didn't work before.
I think RCD process is terminated when the next step starts to run.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - maybe add a comment to that effect?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added at: 0374397


- name: Run all tests (Windows)
if: matrix.os == 'windows-latest'
env:
HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }}
run: npm run test
HZ_VERSION: ${{ matrix.hz_version }}
run: |
Start-Process -FilePath .\rcd-windows-latest -ArgumentList '-version', $Env:HZ_VERSION, '-no-simple-server' -RedirectStandardOutput rcd-stdout.log -RedirectStandardError rcd-stderr.log
# wait for a bit for RCD to download artifacts
sleep 10
echo "RCD Log:"
cat rcd-stdout.log
cat rcd-stderr.log
# make sure to run the coverage in the same step with RCD
npm run coverage
Comment on lines +123 to +127
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only capture the log output for Windows, not Linux.
I'm aware this is copy-pasted from the Python client so it's non-blocking feedback.
It would be nice if this was shared.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we have to refactor the workflows.

RCD logs are sent to atdout/stderr on Linux, but they are redirected to a file in Windows.
Didn't find a good way of redirecting to stdout/stderr on Windows while I was coding the workflow.
So I had to cat them to see its output.

Loading