shibd commented on code in PR #288: URL: https://github.com/apache/pulsar-client-node/pull/288#discussion_r1071954273
########## tests/load-test.sh: ########## @@ -0,0 +1,42 @@ +#!/bin/bash Review Comment: This script is only used in Linux-related workflows and is recommended to be placed in the `/pkg/linux/` directory ########## tests/docker-load-test.sh: ########## @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# NOTE: This script should only run inside a Node.js docker container. +# See ./load-test.sh for details. +set -ex + +# Create an empty directory to test +mkdir -p /app && cd /app +tar zxf /pulsar-client-node/pulsar-client-node.tar.gz +cp /pulsar-client-node/build/Release/Pulsar.node . Review Comment: You can just copy `Pulsar.node` to `/pulsar-client-node/lib/binding` In this way, does not need to change its: `require()` ########## pkg/linux/Dockerfile_linux_glibc: ########## @@ -17,15 +17,19 @@ # under the License. # -ARG NODE_VERSION +FROM centos:7 -FROM node:${NODE_VERSION}-buster +RUN yum update -y +RUN yum install -y gcc gcc-c++ make python3 -RUN apt-get update -y && \ - apt-get install -y \ - curl \ - g++ \ - make \ - python3 +ARG ARCH +WORKDIR /app +RUN SUFFIX=$(echo ${ARCH} | sed 's/86_//') && \ + echo $SUFFIX && \ + curl -O -L https://nodejs.org/download/release/v16.19.0/node-v16.19.0-linux-$SUFFIX.tar.gz && \ Review Comment: Here need to download the same version of Node.js as defined in [workflow](https://github.com/apache/pulsar-client-node/blob/f5fe0c23a4e6cffe9d781271ea08f181bf5bf6e7/.github/workflows/ci-pr-validation.yml#L135-L136) ########## .github/workflows/ci-pr-validation.yml: ########## @@ -167,6 +167,14 @@ jobs: docker run -i -v $PWD:/pulsar-client-node build:latest \ /pulsar-client-node/pkg/linux/build-napi-inside-docker.sh + - name: Test NAPI file in other containers + if: matrix.image == 'linux_glibc' + run: | + ./tests/load-test.sh node:16-buster Review Comment: Can we keep the param node version consistent with `${{matrix.nodejs}}`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org