Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github actions support #83

Merged
merged 3 commits into from
Dec 4, 2022
Merged

add github actions support #83

merged 3 commits into from
Dec 4, 2022

Conversation

linuxmaniac
Copy link
Contributor

As mentioned at #62 project needs to migrate CI to github actions

@linuxmaniac
Copy link
Contributor Author

@goodboy I would love to see the project improve the actual situation. So, lets start with implementing the CI

@goodboy
Copy link
Member

goodboy commented Nov 30, 2022

@linuxmaniac thanks for the the PR!

Do you have an example of this CI run working fully on your fork by chance?

@linuxmaniac
Copy link
Contributor Author

Do you have an example of this CI run working fully on your fork by chance?

I do, but for sure it's not passing

https://github.com/linuxmaniac/pysipp/actions/runs/3565669501/jobs/5991124740

============================= test session starts ==============================
  platform linux -- Python 3.8.14, pytest-7.2.0, pluggy-1.0.0
  cachedir: .tox/py38/.pytest_cache
  rootdir: /home/runner/work/pysipp/pysipp
  collected 59 items
  
  tests/test_agent.py ...............                                      [ 25%]
  tests/test_commands.py .....                                             [ 33%]
  tests/test_launcher.py ..                                                [ 37%]
  tests/test_loader.py ..                                                  [ 40%]
  tests/test_stack.py .F.................................                  [[100](https://github.com/linuxmaniac/pysipp/actions/runs/3565669501/jobs/5991124740#step:5:104)%]
  
  =================================== FAILURES ===================================
  ______________________________ test_confpy_hooks _______________________________
  
  scendir = '/home/runner/work/pysipp/pysipp/tests/scens/'
  
      def test_confpy_hooks(scendir):
          """Test that hooks included in a confpy file work
      
          Assertions here are based on predefined hooks
          """
          path, scen = list(pysipp.walk(scendir + "/default_with_confpy"))[0]
          assert scen.mod
          # ordering hook should reversed agents
          agents = list(scen.agents.values())
  >       assert agents[0].is_client()
  E       assert False
  E        +  where False = <bound method UserAgent.is_client of <pysipp.agent.UserAgent object at 0x7f0fa2228580>>()
  E        +    where <bound method UserAgent.is_client of <pysipp.agent.UserAgent object at 0x7f0fa2228580>> = <pysipp.agent.UserAgent object at 0x7f0fa2228580>.is_client
  
  tests/test_stack.py:47: AssertionError
  =============================== warnings summary ===============================

@linuxmaniac
Copy link
Contributor Author

linuxmaniac commented Dec 1, 2022

Here is a CI for previous py27 but fails on the pypy2 environment

https://github.com/linuxmaniac/pysipp/actions/runs/3594127596

============================= test session starts ==============================
  platform linux2 -- Python 2.7.18[pypy-7.3.9-final], pytest-4.6.11, py-1.11.0, pluggy-0.13.1
  cachedir: .tox/pypy2/.pytest_cache
  rootdir: /home/runner/work/pysipp/pysipp
  collected 59 items
  
  tests/test_agent.py ...............                                      [ 25%]
  tests/test_commands.py .....                                             [ 33%]
  tests/test_launcher.py ..                                                [ 37%]
  tests/test_loader.py ..                                                  [ 40%]
  tests/test_stack.py F..F...............................                  [100%]
  
  =================================== FAILURES ===================================
  _________________________________ test_collect _________________________________
  
  scenwalk = <_functools.partial object at 0x00000000021b7b40>
  
      def test_collect(scenwalk):
          """Verify the scendir filtering hook"""
  >       assert len(list(scenwalk())) == 2
  
  tests/test_stack.py:17: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  .tox/pypy2/site-packages/pysipp/__init__.py:44: in walk
      with plugin.register([netplug] if autolocalsocks else []):
  /opt/hostedtoolcache/PyPy/2.7.18/x64/lib-python/2.7/contextlib.py:17: in __enter__
      return self.gen.next()
  .tox/pypy2/site-packages/pysipp/plugin.py:19: in register
      mng.register(p)
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  
  self = <pluggy.manager.PluginManager object at 0x00000000014754b0>
  plugin = <module 'pysipp.netplug' from '/home/runner/work/pysipp/pysipp/.tox/pypy2/site-packages/pysipp/netplug.pyc'>
  name = None
  
      def register(self, plugin, name=None):
          """ Register a plugin and return its canonical name or ``None`` if the name
          is blocked from registering.  Raise a :py:class:`ValueError` if the plugin
          is already registered. """
          plugin_name = name or self.get_canonical_name(plugin)
      
          if plugin_name in self._name2plugin or plugin in self._plugin2hookcallers:
              if self._name2plugin.get(plugin_name, -1) is None:
                  return  # blocked plugin, return None to indicate no registration
              raise ValueError(
                  "Plugin already registered: %s=%s\n%s"
  >               % (plugin_name, plugin, self._name2plugin)
              )
  E           ValueError: Plugin already registered: pysipp.netplug=<module 'pysipp.netplug' from '/home/runner/work/pysipp/pysipp/.tox/pypy2/site-packages/pysipp/netplug.pyc'>
  E           {'pysipp': <module 'pysipp' from '/home/runner/work/pysipp/pysipp/.tox/pypy2/site-packages/pysipp/__init__.pyc'>, 'pysipp.netplug': <module 'pysipp.netplug' from '/home/runner/work/pysipp/pysipp/.tox/pypy2/site-packages/pysipp/netplug.pyc'>}
  
  .tox/pypy2/site-packages/pluggy/manager.py:[106](https://github.com/linuxmaniac/pysipp/actions/runs/3594127596/jobs/6051989633#step:5:110): ValueError
  ________________________________ test_sync_run _________________________________
  
  scenwalk = <_functools.partial object at 0x000000000226c090>
  
      def test_sync_run(scenwalk):
          """Ensure all scenarios in the test run to completion in synchronous mode"""
  >       for path, scen in scenwalk():
  
  tests/test_stack.py:75: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  .tox/pypy2/site-packages/pysipp/__init__.py:44: in walk
      with plugin.register([netplug] if autolocalsocks else []):
  /opt/hostedtoolcache/PyPy/2.7.18/x64/lib-python/2.7/contextlib.py:17: in __enter__
      return self.gen.next()
  .tox/pypy2/site-packages/pysipp/plugin.py:19: in register
      mng.register(p)
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  
  self = <pluggy.manager.PluginManager object at 0x00000000014754b0>
  plugin = <module 'pysipp.netplug' from '/home/runner/work/pysipp/pysipp/.tox/pypy2/site-packages/pysipp/netplug.pyc'>
  name = None
  
      def register(self, plugin, name=None):
          """ Register a plugin and return its canonical name or ``None`` if the name
          is blocked from registering.  Raise a :py:class:`ValueError` if the plugin
          is already registered. """
          plugin_name = name or self.get_canonical_name(plugin)
      
          if plugin_name in self._name2plugin or plugin in self._plugin2hookcallers:
              if self._name2plugin.get(plugin_name, -1) is None:
                  return  # blocked plugin, return None to indicate no registration
              raise ValueError(
                  "Plugin already registered: %s=%s\n%s"
  >               % (plugin_name, plugin, self._name2plugin)
              )
  E           ValueError: Plugin already registered: pysipp.netplug=<module 'pysipp.netplug' from '/home/runner/work/pysipp/pysipp/.tox/pypy2/site-packages/pysipp/netplug.pyc'>
  E           {'pysipp': <module 'pysipp' from '/home/runner/work/pysipp/pysipp/.tox/pypy2/site-packages/pysipp/__init__.pyc'>, 'pysipp.netplug': <module 'pysipp.netplug' from '/home/runner/work/pysipp/pysipp/.tox/pypy2/site-packages/pysipp/netplug.pyc'>}
  
  .tox/pypy2/site-packages/pluggy/manager.py:106: ValueError
  =============================== warnings summary ===============================

@goodboy
Copy link
Member

goodboy commented Dec 1, 2022

Ok so maybe to just get this all going can we skip the test_confpy_hooks test which seems to be the common failure and then possibly also unrap the suite from using tox.

If you're uncomfortable try that lmk 😸

linuxmaniac and others added 3 commits December 2, 2022 08:55
* we are in the middle of a migration, lets just
  mark this one and later we can figure out what's wrong
@linuxmaniac
Copy link
Contributor Author

@goodboy
Copy link
Member

goodboy commented Dec 4, 2022

@linuxmaniac nice work, maybe make a followup issue for those tests as well so we don't forget about them 😂

@goodboy goodboy merged commit 36b7e2a into SIPp:master Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants