Skip to content

Commit 8a8c01f

Browse files
committed
Updated files
1 parent 879321e commit 8a8c01f

File tree

2 files changed

+55
-66
lines changed

2 files changed

+55
-66
lines changed

.github/workflows/ci_docker_custom_workflow.yml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,21 @@ on:
1212
python_version:
1313
description: 'Python Version'
1414
required: true
15+
type: choice
16+
default: '3.11'
17+
options: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
1518
DEDICATED_DOCKER_TEST:
16-
description: 'Is this Dedicated Image? -> bool'
19+
description: 'Is this Dedicated Image?'
1720
required: true
21+
type: choice
22+
default: 'true'
23+
options: [ 'true', 'false' ]
1824
CONSUMPTION_DOCKER_TEST:
19-
description: 'Is this Consumption Image? -> bool'
25+
description: 'Is this Consumption Image?'
2026
required: true
21-
22-
env:
23-
IMAGE_NAME: ${{ github.event.inputs.image_name }}
27+
type: choice
28+
default: 'false'
29+
options: [ 'true', 'false' ]
2430

2531
jobs:
2632
build:
@@ -32,6 +38,7 @@ jobs:
3238
DEDICATED_DOCKER_TEST: ${{ github.event.inputs.DEDICATED_DOCKER_TEST }}
3339
CONSUMPTION_DOCKER_TEST: ${{ github.event.inputs.CONSUMPTION_DOCKER_TEST }}
3440
python_version: ${{ github.event.inputs.python_version }}
41+
IMAGE_NAME: ${{ github.event.inputs.image_name }}
3542
steps:
3643
- name: Checkout code.
3744
uses: actions/checkout@v2
@@ -41,7 +48,7 @@ jobs:
4148
python-version: ${{ env.python_version }}
4249
- name: Install dependencies
4350
run: |
44-
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple -U -e .[dev]
51+
python -m pip install -U -e .[dev]
4552
- name: Running 3.7 Tests
4653
if: env.python_version == 3.7
4754
env:
@@ -53,7 +60,7 @@ jobs:
5360
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString37 }}
5461
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString37 }}
5562
run: |
56-
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
63+
python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
5764
- name: Running 3.8 Tests
5865
if: env.python_version == 3.8
5966
env:
@@ -65,7 +72,7 @@ jobs:
6572
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString38 }}
6673
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString38 }}
6774
run: |
68-
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
75+
python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
6976
- name: Running 3.9 Tests
7077
if: env.python_version == 3.9
7178
env:
@@ -77,7 +84,7 @@ jobs:
7784
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString39 }}
7885
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString39 }}
7986
run: |
80-
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
87+
python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
8188
- name: Running 3.10 Tests
8289
if: env.python_version == 3.10
8390
env:
@@ -89,11 +96,16 @@ jobs:
8996
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString310 }}
9097
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString310 }}
9198
run: |
92-
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
93-
- name: Codecov
94-
uses: codecov/[email protected]
95-
with:
96-
file: ./coverage.xml # optional
97-
flags: unittests # optional
98-
name: codecov # optional
99-
fail_ci_if_error: false # optional (default = false)
99+
python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
100+
- name: Running 3.11 Tests
101+
if: env.python_version == 3.11
102+
env:
103+
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString311 }}
104+
AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString311 }}
105+
AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString311 }}
106+
AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString311 }}
107+
AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString311 }}
108+
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString311 }}
109+
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString311 }}
110+
run: |
111+
python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
Lines changed: 26 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,38 @@
1-
# This workflow will run all tests in endtoend/tests in a docker container using custom dedicated or consumption image
1+
# This workflow will run all tests in endtoend/tests in a docker container using the latest dedicated image
22

33

44
name: CI Docker Dedicated tests
55

66
on:
77
workflow_dispatch:
8-
inputs:
9-
image_name:
10-
description: 'Image'
11-
required: true
12-
python_version:
13-
description: 'Python Version'
14-
required: true
15-
type: choice
16-
default: '3.11'
17-
options: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
18-
DEDICATED_DOCKER_TEST:
19-
description: 'Is this Dedicated Image?'
20-
required: true
21-
type: choice
22-
default: 'true'
23-
options: [ 'true', 'false' ]
24-
CONSUMPTION_DOCKER_TEST:
25-
description: 'Is this Consumption Image?'
26-
required: true
27-
type: choice
28-
default: 'false'
29-
options: [ 'true', 'false' ]
8+
schedule:
9+
# Monday to Thursday 1 AM PDT build
10+
# * is a special character in YAML so you have to quote this string
11+
- cron: "0 8 * * 1,2,3,4"
3012

3113
jobs:
3214
build:
3315
name: "Python Docker CI Run"
3416
runs-on: ubuntu-latest
3517
strategy:
3618
fail-fast: false
19+
matrix:
20+
python-version: [ 3.7, 3.8, 3.9, "3.10" ]
3721
env:
38-
DEDICATED_DOCKER_TEST: ${{ github.event.inputs.DEDICATED_DOCKER_TEST }}
39-
CONSUMPTION_DOCKER_TEST: ${{ github.event.inputs.CONSUMPTION_DOCKER_TEST }}
40-
python_version: ${{ github.event.inputs.python_version }}
41-
IMAGE_NAME: ${{ github.event.inputs.image_name }}
22+
DEDICATED_DOCKER_TEST: "true"
23+
4224
steps:
4325
- name: Checkout code.
4426
uses: actions/checkout@v2
45-
- name: Set up Python ${{ env.python_version }}
27+
- name: Set up Python ${{ matrix.python-version }}
4628
uses: actions/setup-python@v2
4729
with:
48-
python-version: ${{ env.python_version }}
30+
python-version: ${{ matrix.python-version }}
4931
- name: Install dependencies
5032
run: |
5133
python -m pip install -U -e .[dev]
5234
- name: Running 3.7 Tests
53-
if: env.python_version == 3.7
35+
if: matrix.python-version == 3.7
5436
env:
5537
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString37 }}
5638
AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString37 }}
@@ -60,9 +42,9 @@ jobs:
6042
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString37 }}
6143
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString37 }}
6244
run: |
63-
python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
45+
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
6446
- name: Running 3.8 Tests
65-
if: env.python_version == 3.8
47+
if: matrix.python-version == 3.8
6648
env:
6749
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString38 }}
6850
AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString38 }}
@@ -72,9 +54,9 @@ jobs:
7254
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString38 }}
7355
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString38 }}
7456
run: |
75-
python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
57+
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
7658
- name: Running 3.9 Tests
77-
if: env.python_version == 3.9
59+
if: matrix.python-version == 3.9
7860
env:
7961
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString39 }}
8062
AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString39 }}
@@ -84,9 +66,9 @@ jobs:
8466
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString39 }}
8567
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString39 }}
8668
run: |
87-
python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
69+
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
8870
- name: Running 3.10 Tests
89-
if: env.python_version == 3.10
71+
if: matrix.python-version == 3.10
9072
env:
9173
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }}
9274
AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString310 }}
@@ -96,16 +78,11 @@ jobs:
9678
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString310 }}
9779
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString310 }}
9880
run: |
99-
python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
100-
- name: Running 3.11 Tests
101-
if: env.python_version == 3.11
102-
env:
103-
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString311 }}
104-
AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString311 }}
105-
AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString311 }}
106-
AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString311 }}
107-
AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString311 }}
108-
AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString311 }}
109-
AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString311 }}
110-
run: |
111-
python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
81+
python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
82+
- name: Codecov
83+
uses: codecov/[email protected]
84+
with:
85+
file: ./coverage.xml # optional
86+
flags: unittests # optional
87+
name: codecov # optional
88+
fail_ci_if_error: false # optional (default = false)

0 commit comments

Comments
 (0)