-
Notifications
You must be signed in to change notification settings - Fork 31
Conversation
The TaskCluster task says:
I have no idea where that could have come from, though.. does gometalinter do a |
Yes, seems weird. I have some things I'm going to mess around with tomorrow to troubleshoot. This is my first time seeing this type of error though, and I have run many similar commands in task creator. |
The problem was in trying to checkout and then 'go get -u ./...' in that order. Being on a detached head messed this up. So now we get all our packages first, then checkout, then do the tests. This wasn't a problem before because I was testing on branches before PR #67 was merged and didn't need 'go get -u ./...' at all. But after this merge I was getting import errors. So, good problem to have now, as .taskcluster.yml will be more robust for future changes. |
This has some extra test features, using both 'gometalinter' and adding to 'go test': Gometalinter: Test flags: |
.taskcluster.yml
Outdated
&& go get -u github.com/alecthomas/gometalinter | ||
&& gometalinter --install | ||
&& go get -u ./... | ||
&& git checkout {{ event.head.sha }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines have me a little worried -- it's running go get -u
on the default branch (the one go get -t github.com/taskcluster/taskcluster-cli/...
found), then switching to the commit we want to test. If those have different dependent packages, would this still work?
@walac this is pretty far over my golang head -- can you comment here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to make gometalinter
happy, as it doesn't look for packages inside vendor. Unfortunately, there is no much more we can do about it, since if we try to do go get
after git checkout
, it will fail due to the repo being in a detached state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that mean that we're running our tests against the latest versions of everything, rather than the vendored versions? Or is this just updating gometalinter's own dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to use gometalinter --vendor
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djmitche nope, tests run under vendor, just gometalinter
@t0xicCode oh, I was not aware of vendor option, thanks. @lteigrob could you please give it a try?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I'll add in that flag right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🚢
Changing review based on @djmitche's comments
.taskcluster.yml
Outdated
&& go test -v -race ./... | ||
&& gometalinter --disable-all --enable=gotype --enable=golint | ||
--enable=deadcode --enable=staticcheck --enable=deadcode | ||
--enable=misspell --enable=vet --enable=vetshadow --enable=gosimple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this doesn't run on any of the sub-packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoot. Right you are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few adjustments (see comments)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more points :)
.taskcluster.yml
Outdated
&& go test ./... | ||
&& go get -u github.com/alecthomas/gometalinter | ||
&& gometalinter --install --force | ||
&& go get -u ./... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't need this anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're probably right, but what about with the added race condition check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go test
if fully compatible with vendoring. It's kinda funny the way it does it. When the code is compiled to be tested, the toolchain will pull the dependencies from vendor/, as expected. Then, when go test
runs the tests, it will actually recurse into the folders in vendor/, but because govendor
removes all of the test files from dependencies, no tests are run.
In essence, it matches the behaviour of un-vendored code.
.taskcluster.yml
Outdated
&& go get -u ./... | ||
&& git checkout {{ event.head.sha }} | ||
&& go test -v -race ./... | ||
&& gometalinter --vendor --disable-all --enable=gotype --enable=golint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we might have to run go install ./...
before this. gotype uses the compiled data that is generated by install
to run its checks.
Perhaps for discussion in the meeting: Now that I'm checking subdirectories with gometalinter, my task is failing, I believe due to warnings. You can see this here: From what I can tell this is due to gometalinter setting the exit status to 1 for any such warning. Is this what we want? If so, we'd just have to go through and fix up all these warnings to get everything up to this level of strictness. Alternatively, we allow these warnings but figure out how to keep exit status as zero. I'm not sure there's a way to do this using gometalinter as-is. I'm sure it will fail, but I'll push the change for discussion purposes :) I'd like to talk more about @t0xicCode's comments too |
I'm actually building a PR to fix most of the linting issues. |
Oh, perfect! |
Nice, I'll just figure out the go install vs. go get -u issue and we should be good |
@lteigrob Could you rebase on top of master? I've merged the linting fixes that you approved :) |
One does not simply git rebase it... @t0xicCode, I also had to fetch and merge with the remote gometalinter branch. Not sure if that's normal. I've looked at the code and I don't think I killed anything. |
fe4a30d
to
7266fa0
Compare
I may have managed to do it 😄 but I manually removed a bunch of duplicated commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single point
.taskcluster.yml
Outdated
&& go get -u github.com/alecthomas/gometalinter | ||
&& gometalinter --install --force | ||
&& go install ./... | ||
&& git checkout {{ event.head.sha }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should checkout before running go install
or make
, in case the dependencies changed.
Also, you'll have to do a force pull ( |
.taskcluster.yml
Outdated
&& go install ./... | ||
&& git checkout {{ event.head.sha }} | ||
&& go test -v -race ./... | ||
&& gometalinter --vendor --disable-all --enable=gotype --enable=golint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider --skip=apis/ to skip the auto-generated source (for #100)
Cool, this sequence seems to be working now. I'm sure @djmitche will be happy :) Aaand I got excited and forgot to do the force pull :( If things need to be fixed we can discuss tomorrow. Finally, I'm working on getting '--skip=apis' to work. Like everything else since adding in gometalinter, it's not as simple as it seems. |
Success on Taskcluster!! Should we merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems good. I'd still like to see the code rebased and the duplicate commits removed to keep history clean. @lteigrob you can run git rebase -i master
to remove any of the duplicates and reorder the commits.
I can just squash it when merging.. that'll be easier, I think. |
Yeah, that works too
…On Feb 17, 2017 11:26 AM, "Dustin J. Mitchell" ***@***.***> wrote:
I can just squash it when merging.. that'll be easier, I think.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#96 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABNclUAKpxD7FicSyIb2r8AeFM-IAx25ks5rdcoxgaJpZM4L6GXn>
.
|
Trying out some of the other tests we want in .taskcluster.yml. There will likely be more added to this PR shortly.