Skip to content

Commit

Permalink
Fix shim tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
owais committed Aug 25, 2021
1 parent dfeef75 commit 1ab3bb7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,15 @@ jobs:
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v2
with:
path: .tox
key: tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-core
path: |
.tox
~/.cache/pip
key: v1-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-core
# tox fails on windows and Python3.6 when tox dir is reused between builds so we remove it
- name: fix for windows + py3.6
if: ${{ matrix.os == 'windows-latest' && matrix.python-version == 'py36' }}
shell: pwsh
run: Remove-Item .\.tox\ -Force -Recurse -ErrorAction Ignore
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
- name: Find and merge benchmarks
Expand Down Expand Up @@ -101,8 +108,10 @@ jobs:
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v2
with:
path: .tox
key: tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-core
path: |
.tox
~/.cache/pip
key: v1-tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-core
- name: run tox
run: tox -e ${{ matrix.tox-environment }}
contrib-build:
Expand Down Expand Up @@ -141,8 +150,10 @@ jobs:
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v2
with:
path: .tox
key: tox-cache-${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-contrib
path: |
.tox
~/.cache/pip
key: v1-tox-cache-${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-contrib
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }}
contrib-misc:
Expand Down Expand Up @@ -173,7 +184,9 @@ jobs:
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v2
with:
path: .tox
key: tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-contrib
path: |
.tox
~/.cache/pip
key: v1-tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-contrib
- name: run tox
run: tox -e ${{ matrix.tox-environment }}
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ async def do_task():
spans = self.tracer.finished_spans()
self.assertEqual(len(spans), 3)

spans = sorted(spans, key=lambda x: x.start_time)
parent_span = get_one_by_operation_name(spans, "parent")
self.assertIsNotNone(parent_span)

self.assertIsChildOf(spans[1], parent_span)
self.assertIsNotChildOf(spans[2], parent_span)
spans = [span for span in spans if span != parent_span]
self.assertIsChildOf(spans[0], parent_span)
self.assertIsNotChildOf(spans[1], parent_span)
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,8 @@ def test_bad_solution_to_set_parent(self):
parent_span = get_one_by_operation_name(spans, "parent")
self.assertIsNotNone(parent_span)

self.assertIsChildOf(spans[1], parent_span)
self.assertIsChildOf(spans[2], parent_span)
spans = [s for s in spans if s.name == "send"]
for span in spans:
if span == parent_span:
continue
self.assertIsChildOf(span, parent_span)

0 comments on commit 1ab3bb7

Please sign in to comment.