krzema12 / kotlin-python

Python target for the Kotlin Programming Language. See https://github.com/krzema12/kotlin-python/tree/python-backend/python
https://discuss.kotlinlang.org/t/idea-python-backend/19852
48 stars 1 forks source link

Run MicroPython in box tests on CI #75

Closed krzema12 closed 2 years ago

krzema12 commented 2 years ago

See #51.

Proposed goal: run box tests for MP next to regular Python, with separate report files. A separate Gradle task can be created: microPythonTest.

krzema12 commented 2 years ago

Starting with exposing a flag that makes the box tests use micropython binary.

krzema12 commented 2 years ago
krzema12 commented 2 years ago

Using MicroPython in e2e tests fails with:

Traceback (most recent call last):
  File "python/e2e-tests/out/python-consumer.py", line 1, in <module>
  File "/home/piotr/repos/priv/kotlin-python/python/e2e-tests/out/compiled.py", line 12986, in <module>
MemoryError: memory allocation failed, allocating 26032 bytes

At this line, there's:

def invokeSuspendSuperTypeWithReceiverAndParam(self, receiver, param, completion):
    raise NotImplementedError('It is intrinsic method')

I think using MP in e2e tests has to be postponed until these MemoryErrors are solved.

LouisCAD commented 2 years ago

Just thought about this: the issue might be about the implications of instantiating a NotImplementedError. Maybe it's worth trying to raise a custom thing/error/exception to see what causes this?

Isn't that related to the cost of building the stacktrace? I don't know how that works in Python, but I wouldn't be surprised to learn that it works differently in MicroPython, or that it's just not supported.

krzema12 commented 2 years ago

Thanks, we'll investigate it in https://github.com/krzema12/kotlin-python/issues/84.