Skip to content

api_tests fail to run on EV3 #554

Closed
Closed

Description

@dwalton76

What is the workflow to run api_tests.py? I always get

ERROR: test_tank_units (__main__.TestAPI)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./api_tests.py", line 273, in test_tank_units
    drive = MoveTank(OUTPUT_A, OUTPUT_B)
  File "/home/robot/ev3dev-lang-python/ev3dev2/motor.py", line 1699, in __init__
    MotorSet.__init__(self, motor_specs, desc)
  File "/home/robot/ev3dev-lang-python/ev3dev2/motor.py", line 1548, in __init__
    self.motors[motor_port] = motor_class(motor_port)
  File "/home/robot/ev3dev-lang-python/ev3dev2/motor.py", line 1021, in __init__
    super(LargeMotor, self).__init__(address, name_pattern, name_exact, driver_name=['lego-ev3-l-motor', 'lego-nxt-motor'], **kwargs)
  File "/home/robot/ev3dev-lang-python/ev3dev2/motor.py", line 316, in __init__
    super(Motor, self).__init__(self.SYSTEM_CLASS_NAME, name_pattern, name_exact, **kwargs)
  File "/home/robot/ev3dev-lang-python/ev3dev2/__init__.py", line 201, in __init__
    chain_exception(DeviceNotFound("%s is not connected." % self), None)
  File "/home/robot/ev3dev-lang-python/ev3dev2/__init__.py", line 38, in chain_exception
    raise exception from cause
ev3dev2.DeviceNotFound: LargeMotor(ev3-ports:outA) is not connected.

Activity

  1. ddemidov commented on Nov 1, 2018

    @ddemidov
    Member

    This is how Travis does it:

    script:
    - chmod -R g+rw ./tests/fake-sys/devices/**/*
    - $PYTHON tests/api_tests.py

  2. WasabiFan commented on Nov 1, 2018

    @WasabiFan
    Member

    You should just be able to run the file with python3. Make sure you have submodules cloned and that they are up-to-date.

  3. dwalton76 commented on Nov 2, 2018

    @dwalton76
    CollaboratorAuthor

    On a ubuntu machine I can run them, I did

    $ git clone --recursive https://github.com/dwalton76/ev3dev-lang-python.git
    $ cd ev3dev-lang-python/
    $ chmod -R g+rw ./tests/fake-sys/devices/**/*
    $ ./tests/api_tests.py
    

    but the exact same steps on an EV3 or pi3+brickpi3 gives me the ev3dev2.DeviceNotFound: LargeMotor traceback.

  4. dwalton76 commented on Nov 2, 2018

    @dwalton76
    CollaboratorAuthor

    I see what is happening....ev3dev2/_platform/fake.py is not being used if you run the tests from a device that is running ev3dev.

  5. changed the title [-]How to run api_tests.py?[/-] [+]api_tests fail to run on EV3[/+] on Nov 2, 2018
  6. self-assigned this
    on Nov 2, 2018
  7. WasabiFan commented on Nov 4, 2018

    @WasabiFan
    Member

    Ah, I see; you were running it on the EV3. I misunderstood the original post. Is there a use case for running the tests directly on the EV3?

  8. dwalton76 commented on Nov 4, 2018

    @dwalton76
    CollaboratorAuthor

    I do all of my dev on either a brickpi or ev3 so for me I would use this all the time.

  9. WasabiFan commented on Nov 4, 2018

    @WasabiFan
    Member

    Ah, I get it. That sounds good to me then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions