File tree Expand file tree Collapse file tree 8 files changed +130
-263
lines changed Expand file tree Collapse file tree 8 files changed +130
-263
lines changed Original file line number Diff line number Diff line change
1
+ FROM golang:1.12-stretch as builder
2
+ RUN apt-get update && apt-get install -y \
3
+ git \
4
+ && rm -rf /var/lib/apt/lists/*
5
+ WORKDIR /root/
6
+ RUN go get github.com/google/pprof
7
+
8
+ FROM debian:stretch
9
+
10
+ RUN apt-get update && apt-get install -y \
11
+ curl \
12
+ python \
13
+ make \
14
+ g++ \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ ENV NVM_DIR /root/.nvm
18
+ RUN mkdir -p $NVM_DIR
19
+
20
+ ARG NODE_VERSION
21
+ ARG NVM_NODEJS_ORG_MIRROR
22
+
23
+ # Install nvm with node and npm
24
+ RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash \
25
+ && . $NVM_DIR/nvm.sh \
26
+ && nvm install $NODE_VERSION
27
+
28
+ ENV BASH_ENV /root/.bashrc
29
+
30
+ WORKDIR /root/
31
+ COPY --from=0 /go/bin/pprof /bin
Original file line number Diff line number Diff line change
1
+ FROM golang:1.12-alpine as builder
2
+ RUN apk update && apk upgrade && apk add --no-cache git
3
+ WORKDIR /root/
4
+ RUN go get github.com/google/pprof
5
+
6
+ FROM node:10-alpine
7
+ RUN apk update && apk upgrade && apk add --no-cache bash python g++ make
8
+ WORKDIR /root/
9
+ COPY --from=0 /go/bin/pprof /bin
10
+ RUN chmod a+x /bin/pprof
Original file line number Diff line number Diff line change
1
+ FROM golang:1.12-alpine as builder
2
+ RUN apk update && apk upgrade && apk add --no-cache git
3
+ WORKDIR /root/
4
+ RUN go get github.com/google/pprof
5
+
6
+ FROM node:11-alpine
7
+ RUN apk update && apk upgrade && apk add --no-cache bash python g++ make
8
+ WORKDIR /root/
9
+ COPY --from=0 /go/bin/pprof /bin
10
+ RUN chmod a+x /bin/pprof
Original file line number Diff line number Diff line change
1
+ FROM golang:1.12-alpine as builder
2
+ RUN apk update && apk upgrade && apk add --no-cache git
3
+ WORKDIR /root/
4
+ RUN go get github.com/google/pprof
5
+
6
+ FROM node:6-alpine
7
+ RUN apk update && apk upgrade && apk add --no-cache bash python g++ make
8
+ WORKDIR /root/
9
+ COPY --from=0 /go/bin/pprof /bin
10
+ RUN chmod a+x /bin/pprof
Original file line number Diff line number Diff line change
1
+ FROM golang:1.12-alpine as builder
2
+ RUN apk update && apk upgrade && apk add --no-cache git
3
+ WORKDIR /root/
4
+ RUN go get github.com/google/pprof
5
+
6
+ FROM node:8-alpine
7
+ RUN apk update && apk upgrade && apk add --no-cache bash python g++ make
8
+ WORKDIR /root/
9
+ COPY --from=0 /go/bin/pprof /bin
10
+ RUN chmod a+x /bin/pprof
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- retry () {
4
- for i in {1..3}; do
5
- " ${@ } " && return 0
6
- done
7
- return 1
8
- }
9
-
10
- # Fail on any error.
11
- set -eo pipefail
12
-
13
- # Display commands being run.
14
- set -x
3
+ # Trap all errors.
4
+ trap " echo '** AT LEAST ONE OF TESTS FAILED **'" ERR
15
5
16
- # Record directory of pprof-nodejs.
17
- cd $( dirname $0 ) /..
18
- BASE_DIR=$( pwd)
6
+ # Fail on any error, show commands run.
7
+ set -eox pipefail
19
8
20
- RUN_ONLY_V8_CANARY_TEST=" ${RUN_ONLY_V8_CANARY_TEST:- false} "
21
- echo " $RUN_ONLY_V8_CANARY_TEST "
22
-
23
- # Install nvm.
24
- retry curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash & > /dev/null
25
- export NVM_DIR=" $HOME /.nvm" & > /dev/null
26
- [ -s " $NVM_DIR /nvm.sh" ] && \. " $NVM_DIR /nvm.sh" & > /dev/null
9
+ retry () {
10
+ " ${@ } " || " ${@ } " || " ${@ } " || exit $?
11
+ }
27
12
28
- # Move system test to separate directory to run.
29
- TESTDIR=" $BASE_DIR /run-system-test"
30
- cp -R " system-test" " $TESTDIR "
13
+ cd $( dirname $0 )
31
14
32
- # Run test.
33
- cd " $TESTDIR "
34
- retry go get -t -d .
35
- go test -v -timeout=10m -run TestAgentIntegration -pprof_nodejs_path=" $BASE_DIR " -run_only_v8_canary_test=" $RUN_ONLY_V8_CANARY_TEST " -binary_host=" $BINARY_HOST "
15
+ for i in 6 8 10 11; do
16
+ # Test Linux support for the given node version.
17
+ retry docker build -f Dockerfile.linux --build-arg NODE_VERSION=$i -t node$i -linux .
18
+ docker run -v $PWD /..:/src node$i -linux /src/system-test/test.sh
19
+ # Test Alpine support for the given node version.
20
+ docker build -f Dockerfile.node$i -alpine -t node$i -alpine .
21
+ docker run -v $PWD /..:/src node$i -alpine /src/system-test/test.sh
22
+ done
36
23
37
- # Remove directory where test was run.
38
- rm -r $TESTDIR
24
+ echo ' ** ALL TESTS PASSED **'
You can’t perform that action at this time.
0 commit comments