Skip to content

Commit c3299db

Browse files
authored
Merge pull request #84 from Chisanan232/develop
[CU-86et1f2c8] Add parameter about working directory for test running.
2 parents e6d39f7 + e400b8a commit c3299db

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/rw_poetry_run_test.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ on:
4747
description: "The testing type. In generally, it only has 2 options: 'unit-test' and 'integration-test'."
4848
required: true
4949
type: string
50+
test_working_directory:
51+
description: "The working directory for test running."
52+
required: false
53+
type: string
54+
default: ''
5055
install_dependency_with_group:
5156
description: "Install the dependency by Poetry configuration with dependency group setting. This parameter receive the dependency group naming."
5257
type: string
@@ -124,16 +129,19 @@ jobs:
124129
125130
- name: Build Python runtime environment by Poetry
126131
if: ${{ inputs.install_dependency_with_group != '' || inputs.install_dependency_without_group != '' }}
132+
working-directory: ${{ inputs.test_working_directory }}
127133
run: |
128134
poetry install
129135
130136
- name: Build Python runtime environment by Poetry with dependency group *${{ inputs.install_dependency_with_group }}*
131137
if: ${{ inputs.install_dependency_with_group != '' }}
138+
working-directory: ${{ inputs.test_working_directory }}
132139
run: |
133140
poetry install --with=${{ inputs.install_dependency_with_group }}
134141
135142
- name: Build Python runtime environment by Poetry without dependency group *${{ inputs.install_dependency_without_group }}*
136143
if: ${{ inputs.install_dependency_without_group != '' }}
144+
working-directory: ${{ inputs.test_working_directory }}
137145
run: |
138146
poetry install --without=${{ inputs.install_dependency_without_group }}
139147
@@ -146,10 +154,12 @@ jobs:
146154
run: curl "http://${{ inputs.http_server_host }}:${{ inputs.http_server_port }}/exchangeReport/STOCK_DAY?response=json&date=20170101&stockNo=2331"
147155

148156
- name: Run tests with pytest
157+
working-directory: ${{ inputs.test_working_directory }}
149158
run: poetry run pytest ${{ matrix.test-path }}
150159
continue-on-error: ${{ inputs.keep_run_if_test_fail }}
151160

152161
- name: Rename the code coverage result file
162+
working-directory: ${{ inputs.test_working_directory }}
153163
run: |
154164
mv ./.coverage ./.coverage.${{ inputs.test_type }}.${{ inputs.runtime_os }}-${{ inputs.python_version }}
155165

0 commit comments

Comments
 (0)