Skip to content

Commit a8450a1

Browse files
committed
fix tekton integration test.
Signed-off-by: Morven Cao <lcao@redhat.com>
1 parent 7f81be0 commit a8450a1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.tekton/integration-test.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,25 @@ spec:
8484
# Generate mqtt config file
8585
echo '{"brokerHost":"localhost:1883","username":"","password":"","topics":{"sourceEvents":"sources/maestro/consumers/+/sourceevents","agentEvents":"sources/maestro/consumers/+/agentevents"}}' > secrets/mqtt.config
8686
87+
# Generate pubsub config file
88+
echo '{"projectID":"maestro-test","endpoint":"localhost:8085","insecure":true,"topics":{"sourceEvents":"projects/maestro-test/topics/sourceevents","sourceBroadcast":"projects/maestro-test/topics/sourcebroadcast"},"subscriptions":{"agentEvents":"projects/maestro-test/subscriptions/agentevents-maestro","agentBroadcast":"projects/maestro-test/subscriptions/agentbroadcast-maestro"}}' > secrets/pubsub.config
89+
8790
# Generate db.password
8891
echo 'foobar-bizz-buzz' > secrets/db.password
8992
93+
# Wait for the pubsub emulator to be ready
94+
echo "[INFO] Waiting for pubsub emulator to be ready for connection"
95+
timeout 5m bash -c 'until curl -s http://localhost:8085 > /dev/null 2>&1; do sleep 2s; done'
96+
97+
# Install Python and google-cloud-pubsub for pubsub initialization
98+
dnf -y install python3 python3-pip python3-devel gcc gcc-c++
99+
pip3 install google-cloud-pubsub
100+
101+
# Initialize pubsub topics and subscriptions
102+
export PUBSUB_EMULATOR_HOST=localhost:8085
103+
export PUBSUB_PROJECT_ID=maestro-test
104+
python3 hack/init-pubsub-emulator.py
105+
90106
# Run integration tests with JSON output
91107
make test-integration integration_test_json_output="$test_output_file"
92108
@@ -129,6 +145,16 @@ spec:
129145
volumeMounts:
130146
- mountPath: /mosquitto/data
131147
name: mqttdata
148+
- image: gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators
149+
name: pubsub-test
150+
command:
151+
- gcloud
152+
- beta
153+
- emulators
154+
- pubsub
155+
- start
156+
- --host-port=0.0.0.0:8085
157+
- --project=maestro-test
132158
volumes:
133159
- name: pgdata
134160
emptyDir: {}

0 commit comments

Comments
 (0)