Skip to content

Conversation

@serge-m
Copy link
Contributor

@serge-m serge-m commented Oct 30, 2020

Reference to a related issue in the repository

#437

Add a description

Added test that fails without the fix, added the fix.
Trivial typo probably.

Mention a member

@carsten-kuebler @pmai Could you please take a look?

Check the checklist

  • My code and comments follow the style guidelines and contributors guidelines of this project.
  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests / travis ci pass locally with my changes.

@vkresch
Copy link
Contributor

vkresch commented Nov 2, 2020

@serge-m thanks for opening the PR. It is a good idea to create a unit test for the osi2read.py but instead of uploading a file how about if we generate it in the CI directly with this code? Don't forget to fix the relative import of OSITrace see the CI error here.

@jdsika jdsika requested a review from vkresch November 2, 2020 10:09
@jdsika jdsika added the Bug Problems in the build system, build scripts, etc or faults in the interface. label Nov 2, 2020
Signed-off-by: SergeM <sbmatyunin@gmail.com>
probably a typo

Signed-off-by: SergeM <sbmatyunin@gmail.com>
Signed-off-by: SergeM <sbmatyunin@gmail.com>
Signed-off-by: SergeM <sbmatyunin@gmail.com>
@serge-m serge-m force-pushed the bugfix-osi-trace branch 2 times, most recently from 86f6724 to 0b8c6e8 Compare November 2, 2020 11:15
@serge-m
Copy link
Contributor Author

serge-m commented Nov 2, 2020

Hi @vkresch Thank you for the review. I tried to address those points.
I have now the build failing with another reason:

The command "doxygen" exited with 0.

0.00s$ cd ..

The command "cd .." exited with 0.

3.29s$ python3 -m unittest discover tests

......................E..

======================================================================

ERROR: test_osi_trace (unittest.loader._FailedTest)

----------------------------------------------------------------------

ImportError: Failed to import test module: test_osi_trace

Traceback (most recent call last):

  File "/usr/lib/python3.6/unittest/loader.py", line 428, in _find_test_path

    module = self._get_module_from_name(name)

  File "/usr/lib/python3.6/unittest/loader.py", line 369, in _get_module_from_name

    __import__(name)

  File "/home/travis/build/OpenSimulationInterface/open-simulation-interface/tests/test_osi_trace.py", line 5, in <module>

    from format.OSITrace import OSITrace

  File "/home/travis/build/OpenSimulationInterface/open-simulation-interface/format/OSITrace.py", line 9, in <module>

    from osi3.osi_sensorview_pb2 import SensorView

  File "/home/travis/build/OpenSimulationInterface/open-simulation-interface/osi3/osi_sensorview_pb2.py", line 6, in <module>

    from google.protobuf import descriptor as _descriptor

ModuleNotFoundError: No module named 'google'

----------------------------------------------------------------------

Ran 25 tests in 3.153s

FAILED (errors=1)

The command "python3 -m unittest discover tests" exited with 1.
cache.2

store build cache

Done. Your build exited with 1.

As far as I understand the package and it's dependency (protobuf) are not being installed in travis.
I think the issue can be solved if I add python3 setup.py install or python3 -m pip install . in the travis config. Not sure if that is a good solution. Could you please help with that?

@vkresch
Copy link
Contributor

vkresch commented Nov 2, 2020

Yes you are right! Try adding python3 -m pip install . between line 80 and 81 and between 105 and 106.

@serge-m
Copy link
Contributor Author

serge-m commented Nov 2, 2020

It seems that there is a limited version of python3. It diesn't have `pip`:
The command "python3 setup.py sdist" exited with 0.

$ python3 -m pip install .

/usr/bin/python3: No module named pip

The command "python3 -m pip install ." exited with 1.

$ cd build

https://travis-ci.com/github/OpenSimulationInterface/open-simulation-interface/jobs/424963479#L937

UPD: solved with travis addon

Signed-off-by: SergeM <sbmatyunin@gmail.com>
…endencies; add python3-wheel to remove warnings

Signed-off-by: SergeM <sbmatyunin@gmail.com>
@serge-m
Copy link
Contributor Author

serge-m commented Nov 2, 2020

The tests pass now. I added python3-pip and python3-wheel as dependencies.

@vkresch vkresch merged commit e345aad into OpenSimulationInterface:master Nov 3, 2020
@serge-m serge-m deleted the bugfix-osi-trace branch November 3, 2020 10:28
clemenshabedank pushed a commit that referenced this pull request Dec 9, 2020
* add test for OSITrace

Signed-off-by: SergeM <sbmatyunin@gmail.com>

* bugfix in OSITrace

probably a typo

Signed-off-by: SergeM <sbmatyunin@gmail.com>

* Fixed relative import in the test

Signed-off-by: SergeM <sbmatyunin@gmail.com>

* input data for the test is generated on fly

Signed-off-by: SergeM <sbmatyunin@gmail.com>

* install the module on travis in order to get the dependencies

Signed-off-by: SergeM <sbmatyunin@gmail.com>

* Install the module on travis for deploy stage in order to get the dependencies; add python3-wheel to remove warnings

Signed-off-by: SergeM <sbmatyunin@gmail.com>
Signed-off-by: Habedank Clemens <qxs2704@europe.bmw.corp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Problems in the build system, build scripts, etc or faults in the interface.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants