From: "Yu, Mingli" <mingli.yu@windriver.com>
To: Matt Madison <matt@madison.systems>
Cc: Patches and discussions about the oe-core layer
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH v5 06/13] go.bbclass: ptest cleanup and improvements
Date: Fri, 28 Jun 2019 15:12:30 +0800 [thread overview]
Message-ID: <5D15BDDE.1090003@windriver.com> (raw)
In-Reply-To: <CAGgRHJqHLmiga8CAj7od2OuqRc2MKcnc0cGuXFc1SgMSOMrGGQ@mail.gmail.com>
On 2019年06月27日 19:34, Matt Madison wrote:
> On Wed, Jun 26, 2019 at 11:40 PM Yu, Mingli <mingli.yu@windriver.com> wrote:
>>
>>
>>
>> On 2019年06月26日 22:00, Matt Madison wrote:
>>> On Wed, Jun 26, 2019 at 2:02 AM Yu, Mingli <mingli.yu@windriver.com> wrote:
>>>>
>>>>
>>>>
>>>> On 2019年06月25日 20:23, Matt Madison wrote:
>>>>> On Fri, Jun 21, 2019 at 2:08 AM Yu, Mingli <mingli.yu@windriver.com> wrote:
>>>>>>
>>>>>> Hi Matt,
>>>>>>
>>>>>> I noticed your commit is the latest update for go-dep ptest. But the
>>>>>> go-dep ptest doesn't work in my environment. I'm trying to figure out
>>>>>> what's wrong is here though I didn't know much about go.
>>>>>
>>>>> I went back over the commits, and I don't think I did anything with
>>>>> go-dep specifically. I can see that the tests are failing for it, and
>>>>> it looks like it's because go-dep's test programs make some
>>>>> assumptions about the environment. For one thing, it needs the go
>>>>> compiler installed. It also looks like it's expecting some source
>>>>> files to be present... in other words, it's not really designed for a
>>>>> cross-build setup, with tests run on the cross-built target. It could
>>>>> be messy to work around that, and I'm not sure how useful it would be
>>>>> anyway, seeing as how go-dep is more of a build tool. Might be better
>>>>> to just disable ptests for it completely.
>>>>
>>>> Many thanks Matt for your information!
>>>> Did you ever run go-dep ptest?
>>>> Go through the run-ptest script for go-dep, it actually runs the
>>>> /usr/lib64/go-dep/ptest/github.com/golang/dep/cmd/dep/dep.test whose
>>>> source file is
>>>> https://github.com/golang/dep/blob/master/cmd/dep/dep_test.go.
>>>
>>> Yes, I see that. That main program starts by rebuilding the dep
>>> program from source, then runs the tests using that copy of the
>>> program, so it's assuming that you're still in a development
>>> environment where you can run a full go build. That's what I meant by
>>> it not being designed for a cross-build setup.
>>>
>>> I've patched the test program to create a symlink to the installed dep
>>> program instead of rebuilding, and got further. You'll need to
>>> include 'go', 'git', and 'git-perltools' in the image to get the tests
>>> to run. Some of the test cases failed until I set GOCACHE in the
>>> environment to point to a valid path; I'm not sure why. The tests
>>> took a long time to run on my qemux86 build, though - at least 30
>>> minutes.
>>
>> Thanks very much for Matt's guide!
>>
>> I have applied the patch you provide to create a symlink to the
>> installed dep program instead of rebuilding and also add go', 'git', and
>> 'git-perltools' into the image, but there is no PASS case, all failed as
>> attached go-dep_ptest.log.
>
> The device under test needs Internet access to fetch repos from
> Github. From the log, it looks like perhaps yours didn't?
>
>>
>> BTW, you said you set GOCACHE, what's the valid path do you mean?
>
> Any directory that the user has write access to. The default is
> $HOME/.cache/go-build .
There is no difference after set GOCACHE, still all the case failed.
Thanks,
>
> -M
>
>>
>> Thanks,
>>
>>>
>>> Here's the patch I applied to use the already-built dep binary. An
>>> alternative approach would be to put everything in place to allow the
>>> test program to rebuild the dep binary itself, but that would drive up
>>> the time for the test run even further.
>>>
>>> Regards,
>>> -Matt
>>>
>>> ---
>>> cmd/dep/dep_test.go | 13 +++++++++----
>>> 1 file changed, 9 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/src/github.com/golang/dep/cmd/dep/dep_test.go
>>> b/src/github.com/golang/dep/cmd/dep/dep_test.go
>>> index 687eef3a..535ca56d 100644
>>> --- a/src/github.com/golang/dep/cmd/dep/dep_test.go
>>> +++ b/src/github.com/golang/dep/cmd/dep/dep_test.go
>>> @@ -18,13 +18,18 @@ import (
>>> // deletes it after the tests have been run.
>>> // Most of this is taken from
>>> https://github.com/golang/go/blob/master/src/cmd/go/go_test.go and
>>> reused here.
>>> func TestMain(m *testing.M) {
>>> - args := []string{"build", "-o", "testdep" + test.ExeSuffix}
>>> - out, err := exec.Command("go", args...).CombinedOutput()
>>> + args := []string{"dep"}
>>> + out, err := exec.Command("which", args...).CombinedOutput()
>>> if err != nil {
>>> - fmt.Fprintf(os.Stderr, "building testdep failed: %v\n%s", err, out)
>>> + fmt.Fprintf(os.Stderr, "finding dep failed: %v\n%s", err, out)
>>> + os.Exit(2)
>>> + }
>>> + args = []string{"-s", string(out[:len(out)-1]), "testdep" + test.ExeSuffix}
>>> + out, err = exec.Command("ln", args...).CombinedOutput()
>>> + if err != nil {
>>> + fmt.Fprintf(os.Stderr, "symlinking dep failed: %v\n%s", err, out)
>>> os.Exit(2)
>>> }
>>> -
>>> // Don't let these environment variables confuse the test.
>>> os.Unsetenv("GOPATH")
>>> os.Unsetenv("GIT_ALLOW_PROTOCOL")
>>>
>
next prev parent reply other threads:[~2019-06-28 7:08 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-04 21:09 [PATCH v5 00/13] go1.10 update and misc improvements Matt Madison
2018-03-04 21:09 ` [PATCH v5 01/13] go: update go 1.9 -> go 1.10 Matt Madison
2018-03-04 21:09 ` [PATCH v5 02/13] go: set GOMIPS envrionment variable Matt Madison
2018-03-04 21:09 ` [PATCH v5 03/13] go.bbclass: rename GO_TMPDIR -> GOTMPDIR Matt Madison
2018-03-04 21:09 ` [PATCH v5 04/13] go.bbclass: remove debug-related commands Matt Madison
2018-03-04 21:09 ` [PATCH v5 05/13] go.bbclass: don't stage test data with sources Matt Madison
2018-03-04 21:09 ` [PATCH v5 06/13] go.bbclass: ptest cleanup and improvements Matt Madison
2019-06-21 9:12 ` Yu, Mingli
2019-06-25 12:23 ` Matt Madison
2019-06-26 9:06 ` Yu, Mingli
2019-06-26 14:00 ` Matt Madison
2019-06-27 6:43 ` Yu, Mingli
2019-06-27 11:34 ` Matt Madison
2019-06-28 7:12 ` Yu, Mingli [this message]
2018-03-04 21:09 ` [PATCH v5 07/13] goarch.bbclass: disable shared runtime for nativesdk builds Matt Madison
2018-03-04 21:09 ` [PATCH v5 08/13] go: move common settings to go-common.inc Matt Madison
2018-03-04 21:09 ` [PATCH v5 09/13] go.bbclass, goarch.bbclass: update SECURITY_CFLAGS Matt Madison
2018-03-04 21:09 ` [PATCH v5 10/13] go: disable PIE CFLAGS for nativesdk and cross-canadian builds Matt Madison
2018-03-04 21:09 ` [PATCH v5 11/13] packagegroup-go-sdk-target: add go-runtime-staticdev Matt Madison
2018-03-04 21:09 ` [PATCH v5 12/13] go-runtime: remove unneeded nativesdk override, rename variable Matt Madison
2018-03-04 21:09 ` [PATCH v5 13/13] tcmode-default.inc: add settings for go Matt Madison
2018-03-04 21:34 ` ✗ patchtest: failure for go1.10 update and misc improvements (rev5) Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5D15BDDE.1090003@windriver.com \
--to=mingli.yu@windriver.com \
--cc=matt@madison.systems \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.