Skip to content

Commit

Permalink
Test: Use different consumer groups for different E2E and nightly tes…
Browse files Browse the repository at this point in the history
…ts (#1047)

* test multiple consumer groups on canary

* move nightly jobs to their own consumer groups
  • Loading branch information
BertKleewein authored Sep 1, 2022
1 parent 3da0780 commit 893e446
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions dev_utils/dev_utils/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
else:
IOTHUB_CONNECTION_STRING = os.environ["IOTHUB_CONNECTION_STRING"]
EVENTHUB_CONNECTION_STRING = os.environ.get("EVENTHUB_CONNECTION_STRING")
EVENTHUB_CONSUMER_GROUP = os.getenv("EVENTHUB_CONSUMER_GROUP", None)

DEVICE_CONNECTION_STRING = os.environ.get("IOTHUB_DEVICE_CONNECTION_STRING")

Expand Down
9 changes: 8 additions & 1 deletion vsts/python-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,32 @@ jobs:
pv: '3.9'
transport: 'mqtt'
imageName: 'windows-latest'
consumerGroup: 'cg1'
py39_windows_mqttws:
pv: '3.9'
transport: 'mqttws'
imageName: 'windows-latest'

consumerGroup: 'cg2'
py36_linux_mqtt:
pv: '3.6'
transport: 'mqtt'
imageName: 'Ubuntu 20.04'
consumerGroup: 'cg3'
py37_linux_mqttws:
pv: '3.7'
transport: 'mqttws'
imageName: 'Ubuntu 20.04'
consumerGroup: 'cg4'
py38_linux_mqtt:
pv: '3.8'
transport: 'mqtt'
imageName: 'Ubuntu 20.04'
consumerGroup: 'cg5'
py310_linux_mqtt:
pv: '3.10'
transport: 'mqtt'
imageName: 'Ubuntu 20.04'
consumerGroup: 'cg6'

pool:
vmImage: $(imageName)
Expand All @@ -46,11 +51,13 @@ jobs:

- script: |
cd $(Build.SourcesDirectory)/tests/e2e/iothub_e2e
echo "Using consumer group: ${EVENTHUB_CONSUMER_GROUP}"
pytest --transport=$(transport) --junitxml=junit/TEST-python-e2e.xml -o junit_suite_name="$(Agent.JobName)"
displayName: 'E2E Device Client MQTT Connection String'
env:
IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
EVENTHUB_CONNECTION_STRING: $(EVENTHUB-CONNECTION-STRING)
EVENTHUB_CONSUMER_GROUP: $(consumerGroup)
PYTHONUNBUFFERED: True
- task: PublishTestResults@2
Expand Down
10 changes: 9 additions & 1 deletion vsts/python-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,38 @@ jobs:
pv: '3.9'
transport: 'mqtt'
imageName: 'windows-latest'
consumerGroup: 'cg1'
py39_windows_mqttws:
pv: '3.9'
transport: 'mqttws'
imageName: 'windows-latest'
consumerGroup: 'cg2'

py36_linux_mqtt:
pv: '3.6'
transport: 'mqtt'
imageName: 'Ubuntu 20.04'
consumerGroup: 'cg3'
py37_linux_mqttws:
pv: '3.7'
transport: 'mqttws'
imageName: 'Ubuntu 20.04'
consumerGroup: 'cg4'
py38_linux_mqtt:
pv: '3.8'
transport: 'mqtt'
imageName: 'Ubuntu 20.04'
consumerGroup: 'cg5'
py39_linux_mqttws:
pv: '3.9'
transport: 'mqttws'
imageName: 'Ubuntu 20.04'
consumerGroup: 'cg6'
py310_linux_mqtt:
pv: '3.10'
transport: 'mqtt'
imageName: 'Ubuntu 20.04'
consumerGroup: 'cg7'

pool:
vmImage: $(imageName)
Expand All @@ -50,13 +57,14 @@ jobs:

- script: |
cd $(Build.SourcesDirectory)/tests/e2e/iothub_e2e
echo "Using consumer group: ${IOTHUB_E2E_EVENTHUB_CONSUMER_GROUP}"
# "not x" means "include all tests that don't have the tag named 'x'", which is everything.
pytest --transport=$(transport) --junitxml=junit/TEST-python-e2e.xml -o junit_suite_name="$(Agent.JobName)" -m "not x"
displayName: 'E2E Device Client MQTT Connection String'
env:
IOTHUB_E2E_IOTHUB_CONNECTION_STRING: $(IOTHUB-E2E-CONNECTION-STRING)
IOTHUB_E2E_EVENTHUB_CONNECTION_STRING: $(IOTHUB-E2E-EVENTHUB-CONNECTION-STRING)
IOTHUB_E2E_EVENTHUB_CONSUMER_GROUP: e2e-nightly-stress-consumer-group
IOTHUB_E2E_EVENTHUB_CONSUMER_GROUP: $(consumerGroup)
PYTHONUNBUFFERED: True
- task: PublishTestResults@2
Expand Down

0 comments on commit 893e446

Please sign in to comment.