Skip to content

Commit

Permalink
Update circleci config and remove loop arguments (#1920)
Browse files Browse the repository at this point in the history
Updated Circle CI build settings for modern python and occasional edge cases
  • Loading branch information
vEpiphyte authored Oct 22, 2020
1 parent 5117134 commit c83e564
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 17 deletions.
56 changes: 45 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,14 @@ commands:
- ./venv
key: v5-osx-venv-{{ .Environment.CIRCLE_STAGE }}-{{ .Branch }}-{{ checksum "setup.py" }}

- do_test_execution
- run:
name: run tests
command: |
ulimit -Sn 4096
. venv/bin/activate
mkdir test-reports
circleci tests glob synapse/tests/test_*.py | circleci tests split --split-by=timings | xargs python3 -m pytest -v -s -rs --durations 6 --maxfail 6 -p no:logging --junitxml=test-reports/junit.xml ${COVERAGE_ARGS}
- do_report_coverage

- store_test_results:
Expand Down Expand Up @@ -409,13 +416,13 @@ commands:
jobs:

osx37:
osx38:
parallelism: 4
macos:
xcode: "10.2.0"
xcode: "12.2.0"

environment:
PYVERS: 3.7
PYVERS: 3.8
CODECOV_FLAG: osx
CODECOV_PREFIX: osx
COVERAGE_ARGS: --cov synapse --no-cov-on-fail
Expand Down Expand Up @@ -541,13 +548,12 @@ workflows:
branches:
only: /.*/

# - osx37:
# filters:
# tags:
# only: /.*/
# branches:
# only:
# - master
- osx38:
filters:
tags:
ignore: /.*/
branches:
ignore: /.*/

- python37:
filters:
Expand All @@ -568,12 +574,22 @@ workflows:
tags:
only: /.*/
branches:
only:
- master

- python38_replay:
filters:
tags:
only: /.*/
branches:
only:
- master

- deploy_pypi:
requires:
- doctests
- python37
- python38
filters:
tags:
only: /^v2\.[0-9]+\.[0-9]+((a|b|rc)[0-9]*)?$/
Expand All @@ -584,6 +600,7 @@ workflows:
requires:
- doctests
- python37
- python38
filters:
branches:
only:
Expand All @@ -593,6 +610,7 @@ workflows:
requires:
- doctests
- python37
- python38
context: GithubMachine
filters:
tags:
Expand All @@ -604,6 +622,7 @@ workflows:
requires:
- doctests
- python37
- python38
filters:
tags:
only: /^v2\.[0-9]+\.[0-9]+((a|b|rc)[0-9]*)?$/
Expand All @@ -614,6 +633,7 @@ workflows:
requires:
- doctests
- python37
- python38
filters:
tags:
only: /^v2\.[0-9]+\.[0-9]+((a|b|rc)[0-9]*)?$/
Expand All @@ -630,4 +650,18 @@ workflows:
- master
jobs:
- doctests
- python38
- python38_replay

weekly:
triggers:
- schedule:
cron: "0 12 1 * *"
filters:
branches:
only:
- master
jobs:
- osx38
- python37
- python37_replay
4 changes: 2 additions & 2 deletions synapse/lib/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def __init__(self, base, count, *names):
self.base = base
self.names = names
self.count = count
self.event = asyncio.Event(loop=base.loop)
self.event = asyncio.Event()

self.events = []

Expand Down Expand Up @@ -662,7 +662,7 @@ async def __anit__(self, ctor=None):
self.onfini(self._onBaseRefFini)

async def _onBaseRefFini(self):
await asyncio.gather(*[base.fini() for base in self.vals()], loop=self.loop)
await asyncio.gather(*[base.fini() for base in self.vals()])

def put(self, name, base):
'''
Expand Down
2 changes: 1 addition & 1 deletion synapse/lib/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async def storm(self, text, opts=None):
user = self.core._userFromOpts(opts)

MSG_QUEUE_SIZE = 1000
chan = asyncio.Queue(MSG_QUEUE_SIZE, loop=self.loop)
chan = asyncio.Queue(MSG_QUEUE_SIZE)

info = {'query': text, 'opts': opts}
synt = await self.core.boss.promote('storm', user=user, info=info)
Expand Down
4 changes: 2 additions & 2 deletions synapse/tests/test_axon.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ async def runAxonTestHttp(self, axon):

# Stream file
byts = io.BytesIO(bbuf)

with self.raises(a_exc.ServerDisconnectedError):
with self.raises((a_exc.ServerDisconnectedError,
a_exc.ClientOSError)):
async with sess.post(url_ul, data=byts) as resp:
pass

Expand Down
1 change: 1 addition & 0 deletions synapse/tests/test_lib_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,7 @@ async def test_layer(self):
nodes = await core.nodes('[test:str=bar +#test:score=100]')

async def test_layer_waitForHot(self):
self.thisHostMust(hasmemlocking=True)

async with self.getTestCore() as core:
layr = core.getLayer()
Expand Down
2 changes: 1 addition & 1 deletion synapse/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ class AsyncStreamEvent(io.StringIO, asyncio.Event):
'''
def __init__(self, *args, **kwargs):
io.StringIO.__init__(self, *args, **kwargs)
asyncio.Event.__init__(self, loop=asyncio.get_running_loop())
asyncio.Event.__init__(self)
self.mesg = ''

def setMesg(self, mesg):
Expand Down

0 comments on commit c83e564

Please sign in to comment.