Skip to content

Commit d6303ea

Browse files
chore(tests): added missing test dependency (#387)
1 parent f1d99cc commit d6303ea

File tree

8 files changed

+14
-59
lines changed

8 files changed

+14
-59
lines changed

packages/google-cloud-logging/.kokoro/environment_tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ echo $ENVCTL_ID
7272

7373
# Run the specified environment test
7474
set +e
75+
7576
python3.6 -m nox --session "tests(language='python', platform='$ENVIRONMENT')"
7677
TEST_STATUS_CODE=$?
7778

packages/google-cloud-logging/tests/environment/deployable/nodejs/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ WORKDIR /usr/src/app
2323
COPY package*.json ./
2424
COPY app.js ./
2525
COPY tests.js ./
26-
# Assumption: local file is already built
26+
27+
# Compile library
2728
COPY _library ./nodejs-logging
29+
WORKDIR nodejs-logging
30+
RUN npm install
31+
RUN npm run compile
2832

29-
# Install test app's dependencies.
33+
# Install other dependencies
34+
WORKDIR /usr/src/app
3035
RUN npm install --production
3136

3237
# Environment variable denoting whether to run an app server
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
flask==1.1.2
22
google-cloud-pubsub==2.3.0
33
click==7.1.2
4+
pytz==2021.1

packages/google-cloud-logging/tests/environment/envctl/env_scripts/nodejs/cloudrun.sh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,8 @@ verify() {
6868
set -e
6969
}
7070

71-
build_node_container() {
72-
export GCR_PATH=gcr.io/$PROJECT_ID/logging:$SERVICE_NAME
73-
# copy super-repo into deployable dir
74-
_env_tests_relative_path=${REPO_ROOT#"$SUPERREPO_ROOT/"}
75-
_deployable_dir=$REPO_ROOT/deployable/$LANGUAGE
76-
77-
# copy over local copy of library
78-
pushd $SUPERREPO_ROOT
79-
tar -cvf $_deployable_dir/lib.tar --exclude node_modules --exclude env-tests-logging --exclude test --exclude system-test --exclude .nox --exclude samples --exclude docs .
80-
popd
81-
mkdir -p $_deployable_dir/$LIBRARY_NAME
82-
tar -xvf $_deployable_dir/lib.tar --directory $_deployable_dir/$LIBRARY_NAME
83-
84-
# build container
85-
docker build -t $GCR_PATH $_deployable_dir
86-
docker push $GCR_PATH
87-
}
88-
8971
deploy() {
90-
build_node_container
72+
build_container
9173
gcloud config set run/platform managed
9274
gcloud config set run/region us-west1
9375
gcloud run deploy \

packages/google-cloud-logging/tests/environment/envctl/env_scripts/nodejs/compute.sh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,8 @@ verify() {
4747
set -e
4848
}
4949

50-
51-
build_node_container() {
52-
export GCR_PATH=gcr.io/$PROJECT_ID/logging:$SERVICE_NAME
53-
# copy super-repo into deployable dir
54-
_env_tests_relative_path=${REPO_ROOT#"$SUPERREPO_ROOT/"}
55-
_deployable_dir=$REPO_ROOT/deployable/$LANGUAGE
56-
57-
# copy over local copy of library
58-
pushd $SUPERREPO_ROOT
59-
tar -cvf $_deployable_dir/lib.tar --exclude node_modules --exclude env-tests-logging --exclude test --exclude system-test --exclude .nox --exclude samples --exclude docs .
60-
popd
61-
mkdir -p $_deployable_dir/$LIBRARY_NAME
62-
tar -xvf $_deployable_dir/lib.tar --directory $_deployable_dir/$LIBRARY_NAME
63-
# build container
64-
docker build -t $GCR_PATH $_deployable_dir
65-
docker push $GCR_PATH
66-
}
67-
6850
deploy() {
69-
build_node_container
51+
build_container
7052
gcloud config set compute/zone $ZONE
7153
gcloud compute instances create-with-container \
7254
$SERVICE_NAME \

packages/google-cloud-logging/tests/environment/envctl/env_scripts/nodejs/kubernetes.sh

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,9 @@ attach_or_create_gke_cluster(){
6565
set -e
6666
}
6767

68-
build_node_container(){
69-
export GCR_PATH=gcr.io/$PROJECT_ID/logging:$SERVICE_NAME
70-
# copy super-repo into deployable dir
71-
_env_tests_relative_path=${REPO_ROOT#"$SUPERREPO_ROOT/"}
72-
_deployable_dir=$REPO_ROOT/deployable/$LANGUAGE
73-
74-
# copy over local copy of library
75-
pushd $SUPERREPO_ROOT
76-
tar -cvf $_deployable_dir/lib.tar --exclude node_modules --exclude env-tests-logging --exclude test --exclude system-test --exclude .nox --exclude samples --exclude docs .
77-
popd
78-
mkdir -p $_deployable_dir/$LIBRARY_NAME
79-
tar -xvf $_deployable_dir/lib.tar --directory $_deployable_dir/$LIBRARY_NAME
80-
# build container
81-
docker build -t $GCR_PATH $_deployable_dir
82-
docker push $GCR_PATH
83-
}
84-
8568
deploy() {
8669
attach_or_create_gke_cluster
87-
build_node_container
70+
build_container
8871
cat <<EOF > $TMP_DIR/gke.yaml
8972
apiVersion: apps/v1
9073
kind: Deployment

packages/google-cloud-logging/tests/environment/envctl/envctl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ build_container() {
4646
tar -cvf $_deployable_dir/lib.tar \
4747
--exclude tests --exclude .nox --exclude samples --exclude docs --exclude __pycache__ \
4848
--exclude target --exclude env-tests-logging --exclude test --exclude .git --exclude .github \
49+
--exclude node_modules --exclude system-test \
4950
--exclude system-test --exclude environment-tests --exclude .kokoro .
5051
popd
5152
mkdir -p $_deployable_dir/_library

tests/environment

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 3b5b391d6afc746c59cdd3100ccc5e8d60793489
1+
Subproject commit f30dafa8b62bf197e39edd5aca57ce1cc62e9540

0 commit comments

Comments
 (0)