toml-lang / toml-test

A language agnostic test suite for TOML parsers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to install the `toml-test` binary?

kaushalmodi opened this issue · comments

Hello,

I am not a Go user, but I use this amazing test library to test the toml parser in Nim.

Some time ago, if I did go get -u -v github.com/BurntSushi/toml-test, the toml-test executable used to get installed as $GOPATH/bin/toml-test.

But now if I do go get -u -v github.com/BurntSushi/toml-test@master, no executable is getting installed.

But if I do go get -u -v github.com/BurntSushi/toml-test@9767d201, I see the executable updating in $GOPATH/bin/ once again.

I am on go 1.16.5.

Has something changed in this repo that's disabling the executable compilation by default?

The binary is now in ./cmd/toml-test, so you'll need to use github.com/BurntSushi/toml-test/cmd/toml-test.

Thanks for the quick reply!

I'll try that out in a second.

Also, if you don't mind, would you know what would cause this error on GHA?

https://github.com/NimParsers/parsetoml/pull/50/checks?check_run_id=2965692522#step:8:37

go: downloading github.com/BurntSushi/toml-test v0.1.1-0.20201027023549-9767d201b51a
go: downloading github.com/BurntSushi/toml v0.3.1
github.com/BurntSushi/toml
github.com/BurntSushi/toml-test
Cannot read invalid directory (tests/invalid): open tests/invalid: no such file or directory
     Error: Exception raised during nimble script execution

I am painfully trying to make this toml-test work using GHA as I am transitioning from Travis: NimParsers/parsetoml#50

go get -u -v github.com/BurntSushi/toml-test/cmd/toml-test@master

That works!

I'll close this issue, but I'll really appreciate if you can help with my above comment.

Do you still have that with the latest version? Previous versions read tests from the filesystem, and the error is because it can't find those tests. But the latest version has the tests built in the binary, so it should just go away.

The latest @master toml-test builds fine for me, but the Nim toml parser is failing at 49 tests after the test suite upgrade to 1.0.0.

I am first trying to get the CI to the previously passing state where all toml-test tests passed. But that was in Travis.
Looks like some path handling is different in Travis go installation vs GHA setup-go installation, and so I am seeing this error:

https://github.com/NimParsers/parsetoml/runs/2965951567

go: creating new go.mod: module github.com/NimParsers/parsetoml
go: finding github.com/BurntSushi/toml-test 9767d201
go: downloading github.com/BurntSushi/toml-test v0.1.1-0.20201027023549-9767d201b51a
go: finding github.com/BurntSushi/toml v0.3.1
go: downloading github.com/BurntSushi/toml v0.3.1
github.com/BurntSushi/toml
github.com/BurntSushi/toml-test
Cannot read invalid directory (/home/runner/go/src/github.com/BurntSushi/toml-test/tests/invalid): open /home/runner/go/src/github.com/BurntSushi/toml-test/tests/invalid: no such file or directory

I am doing this using the 9767d20 commit version of toml-test:

go get -u -v github.com/BurntSushi/toml-test@9767d201 
toml-test -testdir $GOPATH/src/github.com/BurntSushi/toml-test/tests decoder/decoder

Also, I am using 1.11.15 go version (I know it's a really old version, but that's what Travis used by default). Problem is that above command works fine locally, but borks on GHA :|.

Yeah, you need Go 1.16. There are binaries on the release page, you can use those in the CI.

Some of the tests in the previous version were wrong, and some things might fail incorrectly since your library says it supports TOML 0.5 but that version of toml-test only really supports TOML 0.3. I don't really recommend you use it as it can be quite confusing. When I took over maintainership of this and the associated Go TOML library I lost quite some time over this in confusion.

You can use the -skip flag to skip certain tests by the way, which is convenient for features you haven't implemented yet. skip valid/foo* works as expected too.

You can use the -skip flag to skip certain tests by the way

That works!!!

Thanks a lot!