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

Python tests #227

Merged
merged 11 commits into from
Oct 25, 2023
Merged

Python tests #227

merged 11 commits into from
Oct 25, 2023

Conversation

sheridanchris
Copy link
Contributor

@sheridanchris sheridanchris commented Sep 15, 2023

Proposed Changes

Add python tests that can be executed in CI through an optional build target.
You can run these tests with ./build.sh RunPythonTests

@dbrattli
Copy link

This bug is fixed in Fable 4.2.2. But there's a another error now that blocks this PR:

ImportError: cannot import name 'start_child' from 'fable_modules.fable_library.async_'

I'll see if I can fix this as well but it might take some time since it requires rework of the async scheduler / trampoline to handle async parallel correctly.

@TheAngryByrd
Copy link
Collaborator

Thanks for looking into it!

@dbrattli
Copy link

Have a local fix, all tests are green. Need to do some more testing to check there's no other regressions, and then we need to release another Fable.

Screenshot 2023-10-16 at 09 15 24

@TheAngryByrd TheAngryByrd force-pushed the python-tests branch 2 times, most recently from bb2adcd to 7e5efcf Compare October 21, 2023 02:34
@TheAngryByrd TheAngryByrd force-pushed the python-tests branch 2 times, most recently from 9bd5236 to 0f3df7c Compare October 21, 2023 02:35
@TheAngryByrd
Copy link
Collaborator

TheAngryByrd commented Oct 21, 2023

@dbrattli Thanks for looking into all the issues! I really appreciate the work you've put into fable-python.

Got one more for ya. Windows builds are failing with:

> "python" "tests/FsToolkit.ErrorHandling.Tests\.python-tests\main.py" (In: false, Out: false, Err: false)
Traceback (most recent call last):
  File "D:\a\FsToolkit.ErrorHandling\FsToolkit.ErrorHandling\tests\FsToolkit.ErrorHandling.Tests\.python-tests\main.py", line 34, in <module>
    main(sys.argv[1:])
  File "D:\a\FsToolkit.ErrorHandling\FsToolkit.ErrorHandling\tests\FsToolkit.ErrorHandling.Tests\.python-tests\main.py", line 30, in main
    return Pyxpecto_runTests(all_tests)
  File "D:\a\FsToolkit.ErrorHandling\FsToolkit.ErrorHandling\tests\FsToolkit.ErrorHandling.Tests\.python-tests\fable_modules\fable_pyxpecto\pyxpecto.py", line 1019, in Pyxpecto_runTests
    return Pyxpecto_runViaPy(test)
  File "D:\a\FsToolkit.ErrorHandling\FsToolkit.ErrorHandling\tests\FsToolkit.ErrorHandling.Tests\.python-tests\fable_modules\fable_pyxpecto\pyxpecto.py", line 987, in Pyxpecto_runViaPy
    to_console(printf("\U0001f680 start running tests ..."))
  File "D:\a\FsToolkit.ErrorHandling\FsToolkit.ErrorHandling\tests\FsToolkit.ErrorHandling.Tests\.python-tests\fable_modules\fable_library\string_.py", line 68, in to_console
    return continue_print(print, arg)
  File "D:\a\FsToolkit.ErrorHandling\FsToolkit.ErrorHandling\tests\FsToolkit.ErrorHandling.Tests\.python-tests\fable_modules\fable_library\string_.py", line 61, in continue_print
    ret = arg.cont(cont)
  File "D:\a\FsToolkit.ErrorHandling\FsToolkit.ErrorHandling\tests\FsToolkit.ErrorHandling.Tests\.python-tests\fable_modules\fable_library\string_.py", line 199, in _
    return cont(str)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f680' in position 0: character maps to <undefined>
Finished (Failed) 'PythonTest' in 00:00:28.5431365

Any ideas?

@dbrattli
Copy link

This one is a bit weird. Cannot reproduce. Not sure what the difference can be. fable-compiler/Fable#3563

@TheAngryByrd
Copy link
Collaborator

This one is a bit weird. Cannot reproduce. Not sure what the difference can be. fable-compiler/Fable#3563

Yeah and I can't reproduce it locally on my windows box either 😢

dotnet --info
.NET SDK:
 Version:   7.0.401
 Commit:    eb26aacfec

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22621
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.401\

python --version
Python 3.10.7

@TheAngryByrd TheAngryByrd force-pushed the python-tests branch 2 times, most recently from f10318c to 8853dbf Compare October 25, 2023 23:11
@TheAngryByrd
Copy link
Collaborator

run: |
  chcp 65001
  ./build.cmd PythonTest
env:
  PYTHONIOENCODING: utf-8

This seemed to have worked 🤷‍♂️

@TheAngryByrd TheAngryByrd merged commit 75bdb37 into demystifyfp:master Oct 25, 2023
25 checks passed
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.

None yet

3 participants