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

fixes ./... syntax in tinygo test #2885

Merged
merged 2 commits into from Jun 11, 2022
Merged

Conversation

jcchavezs
Copy link

@jcchavezs jcchavezs commented Jun 1, 2022

Adds proper support for ./... syntax which was broken or maybe never intended to be supported and it only somehow worked because we use go list underneath. Allowing to use ./... is actually a good experience in go test.

For example, running the tinygo@0.23.0 like:

$ tinygo test ./tests/testing/threedots/...
ok      github.com/tinygo-org/tinygo/tests/testing/threedots/pass       0.106s

whereas ./tests/testing/threedots has two packages.

Closes #2892

@dkegel-fastly
Copy link
Contributor

@dkegel-fastly dkegel-fastly commented Jun 1, 2022

Could you link to (and if needed, file) a tinygo issue describing the problem you're trying to solve? Thanks!

1 similar comment
@dkegel-fastly
Copy link
Contributor

@dkegel-fastly dkegel-fastly commented Jun 1, 2022

Could you link to (and if needed, file) a tinygo issue describing the problem you're trying to solve? Thanks!

@@ -89,7 +90,7 @@ type Package struct {
// Load loads the given package with all dependencies (including the runtime
// package). Call .Parse() afterwards to parse all Go files (including CGo
// processing, if necessary).
func Load(config *compileopts.Config, inputPkgs []string, clangHeaders string, typeChecker types.Config) (*Program, error) {
func Load(config *compileopts.Config, inputPkg string, clangHeaders string, typeChecker types.Config) (*Program, error) {
Copy link
Author

@jcchavezs jcchavezs Jun 2, 2022

Choose a reason for hiding this comment

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

I turned this into a single package for a few reasons:

  1. It is used for single package only everywhere.
  2. It is easier to deal with a single package.
  3. This error is only looking at one package and it is actually thought of a single package

@jcchavezs jcchavezs changed the title fix: fixes go test ./... syntax. fixes tinygo test ./... syntax and dependency orders Jun 2, 2022
@jcchavezs jcchavezs changed the base branch from release to dev Jun 2, 2022
@jcchavezs
Copy link
Author

@jcchavezs jcchavezs commented Jun 2, 2022

@dkegel-fastly I linked the problem in the description. Do you want me to create a github issue?

@jcchavezs jcchavezs changed the title fixes tinygo test ./... syntax and dependency orders fixes dependency order in tinygo test Jun 2, 2022
@dkegel-fastly
Copy link
Contributor

@dkegel-fastly dkegel-fastly commented Jun 2, 2022

Yeah, at least for now, it would help if you had a github issue / github PR pair for each individual problem you are solving. (I used to try to do multiple problems in one PR, but life is better with just one problem per PR, linked to a clear issue with reproducer.)

@jcchavezs jcchavezs changed the title fixes dependency order in tinygo test fixes ./... syntax in tinygo test Jun 3, 2022
@jcchavezs
Copy link
Author

@jcchavezs jcchavezs commented Jun 5, 2022

Did a cherry-pick of this commit to try the smoke test cc @dkegel-fastly

@jcchavezs
Copy link
Author

@jcchavezs jcchavezs commented Jun 5, 2022

It is green :D @dkegel-fastly

@dkegel-fastly
Copy link
Contributor

@dkegel-fastly dkegel-fastly commented Jun 5, 2022

I would suggest cleaning up the commit history in this branch a bit... make it looks like you got it right the first try. No need to show dirty laundry!

@jcchavezs
Copy link
Author

@jcchavezs jcchavezs commented Jun 6, 2022

@deadprogram
Copy link
Member

@deadprogram deadprogram commented Jun 6, 2022

Hello, @jcchavezs and @dkegel-fastly

Having atomic commits and a clean history is part of our merge/rebase criteria. If you want to preserve additional info, I would suggest keep that in a branch on a fork.

Hopefully that helps clarify. Thank you!

@jcchavezs
Copy link
Author

@jcchavezs jcchavezs commented Jun 6, 2022

jcchavezs and others added 2 commits Jun 6, 2022
…g#2892

tests/testing/recurse has two directories with tests;
"make smoketest" now does "tinygo test ./..." in that directory
and fails if it does not run both directories' tests.
@jcchavezs
Copy link
Author

@jcchavezs jcchavezs commented Jun 6, 2022

I cleaned up the commits.

@jcchavezs
Copy link
Author

@jcchavezs jcchavezs commented Jun 7, 2022

Can we get this merged please?

@dkegel-fastly
Copy link
Contributor

@dkegel-fastly dkegel-fastly commented Jun 7, 2022

Give it a couple days :-)

@jcchavezs
Copy link
Author

@jcchavezs jcchavezs commented Jun 10, 2022

Shall we?

@dgryski
Copy link
Member

@dgryski dgryski commented Jun 10, 2022

I'll review this today.

Copy link
Member

@dgryski dgryski left a comment

LGTM

@deadprogram
Copy link
Member

@deadprogram deadprogram commented Jun 11, 2022

Thank you very much for working on this @jcchavezs now merging.

@deadprogram deadprogram merged commit ada1109 into tinygo-org:dev Jun 11, 2022
8 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

4 participants