Skip to content

Conversation

@drew-512
Copy link
Contributor

No description provided.

@codecov
Copy link

codecovbot commented Feb 7, 2022

Codecov Report

Merging #159 (c67547f) into master (727b7c4) will decrease coverage by 1.43%.
The diff coverage is 10.36%.

Impacted file tree graph

@@ Coverage Diff @@## master #159 +/- ## ========================================== - Coverage 74.40% 72.96% -1.44%  ========================================== Files 66 70 +4 Lines 11395 11647 +252 ========================================== + Hits 8478 8498 +20 - Misses 2351 2583 +232  Partials 566 566 
Impacted FilesCoverage Δ
examples/embedding/main.go0.00% <0.00%> (ø)
py/util.go0.00% <0.00%> (ø)
examples/embedding/mylib.module.go32.25% <32.25%> (ø)
repl/cli/cli.go0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 727b7c4...c67547f. Read the comment docs.

Copy link
Member

@sbinetsbinet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

but could we find a way to wire the examples into either a func ExampleXXX or func TestXXX scaffolding?
so everything is tested w/ go test ./...?
(I guess func TestXXX would be easier)

@drew-512
Copy link
ContributorAuthor

I had that thought as well. If I make the example's main optionally output to a file, in the TestXXX variant I could just compare that output against a known output as the test. How does that sound?

@sbinet
Copy link
Member

yes, that, or have everything being compiled as part of the func TestXXX:

  • compile the main package,
  • run the output executable with os/exec.Command,
  • capture stdout/stderr and
  • compare with some reference.
    we did something along these lines for go-python/gopy

@drew-512
Copy link
ContributorAuthor

How does this look? I'm not well versed in this sort of stuff, so lmk what I'm missing, thanks.

@drew-512
Copy link
ContributorAuthor

@sbinet This works on my setup but it looks like I need help getting it work with CI here.

@sbinet
Copy link
Member

sbinet commented Feb 12, 2022

it probably is coming from this:

=== RUN TestEmbeddedExample main_test.go:64: could not run diff command: exit status 1 main_test.go:66: test output differ: --- testdata/embedding_golden.txt 2022-02-12 14:36:59.468987820 +0100 +++ /tmp/go-python-embedding-181936362/out.txt 2022-02-12 14:50:15.575695331 +0100 @@ -4,7 +4,7 @@ ========================================================== Python 3.4 (github.com/go-python/gpython) - go1.17.6 on darwin amd64 + devel go1.18-a5c0b19080 Sun Jan 30 02:29:51 2022 +0000 on linux amd64 ========================================================== Spring Break itinerary: --- FAIL: TestEmbeddedExample (0.50s) FAIL FAIL github.com/go-python/gpython/examples/embedding 0.507s FAIL 

@drew-512
Copy link
ContributorAuthor

Sigh, so I guess windows needed to be exe.exe? I test for windows at runtime and append an ".exe"?

@drew-512
Copy link
ContributorAuthor

yay!

Copy link
Member

@sbinetsbinet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sbinetsbinet merged commit 7f55cd3 into go-python:masterFeb 12, 2022
@sbinetsbinet mentioned this pull request Feb 13, 2022
@drew-512drew-512 deleted the add-examples branch February 17, 2022 02:04
Sign up for freeto 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

@drew-512@sbinet