public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Mark Asselstine <mark.asselstine@windriver.com>
To: Alexander Kanavin <alex.kanavin@gmail.com>,
	Stefan Herbrechtsmeier
	<stefan.herbrechtsmeier-oss@weidmueller.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>,
	Lukas Funke <lukas.funke@weidmueller.com>,
	Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Subject: Re: [OE-core] [PATCH 5/5] oe-selftest: add go recipe create selftest
Date: Wed, 11 May 2022 16:08:51 -0400	[thread overview]
Message-ID: <7c6d7c1c-d449-e4a2-6773-bc49ee2983b4@windriver.com> (raw)
In-Reply-To: <CANNYZj8p-CCSWSSfw1TkqUs0wkbcsTCW5y_=-szZS0WHcetQCQ@mail.gmail.com>



On 2022-05-06 03:16, Alexander Kanavin wrote:
> Also here an explanation of what the test does would be useful.
> 
> Please keep in mind: writing code is only half the job. You need to
> explain it to non-specialists too, we're already struggling with items
> which are understood by few people, or in some cases only one person.
> 
> Alex
> 
> On Fri, 6 May 2022 at 09:00, Stefan Herbrechtsmeier
> <stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>>
>> From: Lukas Funke <lukas.funke@weidmueller.com>
>>
>> Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
>>
>> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>> ---
>>
>>   meta/lib/oeqa/selftest/cases/recipetool.py | 88 ++++++++++++++++++++++
>>   1 file changed, 88 insertions(+)
>>
>> diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py
>> index 510dae6bad..bb36e7b6d5 100644
>> --- a/meta/lib/oeqa/selftest/cases/recipetool.py
>> +++ b/meta/lib/oeqa/selftest/cases/recipetool.py
>> @@ -530,6 +530,94 @@ class RecipetoolTests(RecipetoolBase):
>>           libpath = os.path.join(get_bb_var('COREBASE'), 'scripts', 'lib', 'recipetool')
>>           sys.path.insert(0, libpath)
>>
>> +    def test_recipetool_create_go(self):
>> +        # Basic test to check go recipe generation
>> +        def urifiy(url, version, path = None, subdir = None):
>> +            path = ",path='%s'" % path if path else ''
>> +            subdir = ",subdir='%s'" % subdir if subdir else ''
>> +            return "${@go_src_uri('%s','%s'%s%s)}" % (url, path, subdir)
>> +
>> +        temprecipe = os.path.join(self.tempdir, 'recipe')
>> +        os.makedirs(temprecipe)

I hate anything that has the potential to generate a python splat 
existing. At any rate you have matched what the other tests do so no 
change required (maybe the test framework catches splats, I am not 
familiar enough with the test framework to know). Typically I would want 
to see this call in a try block.

>> +        recipefile = os.path.join(temprecipe, 'edgex-go_git.bb')
>> +        srcuri = 'https://github.com/edgexfoundry/edgex-go.git'
>> +        srcrev = "v2.2.0-dev.54"
>> +        result = runCmd('recipetool create -o %s %s -S %s' % (temprecipe, srcuri, srcrev))
>> +        self.assertTrue(os.path.isfile(recipefile))
>> +        checkvars = {}
>> +        src_uri = ['git://${GO_IMPORT};nobranch=1;name=${BPN}']
>> +        checkvars['LIC_FILES_CHKSUM'] = set(['file://src/${GO_IMPORT}/LICENSE;md5=71a6955f3cd81a809549da266346dc59'])
>> +        checkvars['GO_IMPORT'] = "github.com/edgexfoundry/edgex-go"
>> +        inherits = ['go-vendor']
>> +        dependencies = \
>> +            [
>> +                ('bitbucket.org/bertimus9/systemstat'),
>> +                ('github.com/edgexfoundry/go-mod-bootstrap','github.com/edgexfoundry/go-mod-bootstrap/v2'),
>> +                ('github.com/edgexfoundry/go-mod-core-contracts''github.com/edgexfoundry/go-mod-core-contracts/v2'),
>> +                ('github.com/edgexfoundry/go-mod-messaging','github.com/edgexfoundry/go-mod-messaging/v2'),
>> +                ('github.com/edgexfoundry/go-mod-registry','github.com/edgexfoundry/go-mod-registry/v2'),
>> +                ('github.com/edgexfoundry/go-mod-secrets','github.com/edgexfoundry/go-mod-secrets/v2'),
>> +                ('github.com/fxamacker/cbor','github.com/fxamacker/cbor/v2'),
>> +                ('github.com/golang-jwt/jwt','github.com/golang-jwt/jwt/v4'),
>> +                ('github.com/gomodule/redigo'),
>> +                ('github.com/google/uuid'),
>> +                ('github.com/gorilla/mux'),
>> +                ('github.com/lib/pq'),
>> +                ('github.com/pelletier/go-toml'),
>> +                ('github.com/spiffe/go-spiffe','github.com/spiffe/go-spiffe/v2'),
>> +                ('github.com/stretchr/testify'),
>> +                ('go.googlesource.com/crypto','golang.org/x/crypto'),
>> +                ('gopkg.in/eapache/queue.v1'),
>> +                ('gopkg.in/yaml.v3'),
>> +                ('github.com/armon/go-metrics'),
>> +                ('github.com/cenkalti/backoff'),
>> +                ('github.com/davecgh/go-spew'),
>> +                ('github.com/eclipse/paho.mqtt.golang'),
>> +                ('github.com/edgexfoundry/go-mod-configuration','github.com/edgexfoundry/go-mod-configuration/v2'),
>> +                ('github.com/fatih/color'),
>> +                ('github.com/go-kit/log'),
>> +                ('github.com/go-logfmt/logfmt'),
>> +                ('github.com/go-playground/locales'),
>> +                ('github.com/go-playground/universal-translator'),
>> +                ('github.com/go-playground/validator','github.com/go-playground/validator/v10'),
>> +                ('github.com/go-redis/redis','github.com/go-redis/redis/v7'),
>> +                ('github.com/golang/protobuf'),
>> +                ('github.com/gorilla/websocket'),
>> +                ('github.com/hashicorp/consul','api'),
>> +                ('github.com/hashicorp/errwrap'),
>> +                ('github.com/hashicorp/go-cleanhttp'),
>> +                ('github.com/hashicorp/go-hclog'),
>> +                ('github.com/hashicorp/go-immutable-radix'),
>> +                ('github.com/hashicorp/go-multierror'),
>> +                ('github.com/hashicorp/go-rootcerts'),
>> +                ('github.com/hashicorp/golang-lru'),
>> +                ('github.com/hashicorp/serf'),
>> +                ('github.com/leodido/go-urn'),
>> +                ('github.com/mattn/go-colorable'),
>> +                ('github.com/mattn/go-isatty'),
>> +                ('github.com/mitchellh/consulstructure'),
>> +                ('github.com/mitchellh/copystructure'),
>> +                ('github.com/mitchellh/go-homedir'),
>> +                ('github.com/mitchellh/mapstructure'),
>> +                ('github.com/mitchellh/reflectwalk'),
>> +                ('github.com/pebbe/zmq4'),
>> +                ('github.com/pmezard/go-difflib'),
>> +                ('github.com/stretchr/objx'),
>> +                ('github.com/x448/float16'),
>> +                ('github.com/zeebo/errs'),
>> +                ('go.googlesource.com/net','golang.org/x/net'),
>> +                ('go.googlesource.com/sys','golang.org/x/sys'),
>> +                ('go.googlesource.com/text','golang.org/x/text'),
>> +                ('github.com/googleapis/go-genproto','google.golang.org/genproto'),
>> +                ('github.com/grpc/grpc-go','google.golang.org/grpc'),
>> +                ('go.googlesource.com/protobuf','google.golang.org/protobuf'),
>> +                ('gopkg.in/square/go-jose.v2'),
>> +            ]
>> +        src_uri = {urifiy(*d) for d in dependencies}
>> +        checkvars['SRC_URI'] = set(src_uri)
>> +        self.maxDiff = None
>> +        self._test_recipe_contents(recipefile, checkvars, inherits)
>> +

Trailing whitespace.

MarkA

>>       def _copy_file_with_cleanup(self, srcfile, basedstdir, *paths):
>>           dstdir = basedstdir
>>           self.assertTrue(os.path.exists(dstdir))
>> --
>> 2.30.2
>>
>>
>>
>>
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#165332): https://lists.openembedded.org/g/openembedded-core/message/165332
>> Mute This Topic: https://lists.openembedded.org/mt/90928692/3616946
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [mark.asselstine@windriver.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>


  reply	other threads:[~2022-05-11 20:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06  6:59 [PATCH 1/5] recipetool-create: add ensure_native_cmd function Stefan Herbrechtsmeier
2022-05-06  6:59 ` [PATCH 2/5] create_npm: reuse ensure_native_cmd from create.py Stefan Herbrechtsmeier
2022-05-06  6:59 ` [PATCH 3/5] poky-meta: add go vendor class for offline builds Stefan Herbrechtsmeier
2022-05-11 20:42   ` [OE-core] " Mark Asselstine
2022-05-06  6:59 ` [PATCH 4/5] recipetool: add go recipe generator Stefan Herbrechtsmeier
2022-05-06  7:15   ` [OE-core] " Alexander Kanavin
2022-05-11 20:37     ` Mark Asselstine
2022-05-06  6:59 ` [PATCH 5/5] oe-selftest: add go recipe create selftest Stefan Herbrechtsmeier
2022-05-06  7:16   ` [OE-core] " Alexander Kanavin
2022-05-11 20:08     ` Mark Asselstine [this message]
2022-05-06  7:09 ` [OE-core] [PATCH 1/5] recipetool-create: add ensure_native_cmd function Alexander Kanavin
2022-05-11 19:45   ` Mark Asselstine
2022-05-11 19:47     ` Mark Asselstine
2022-05-09 21:46 ` Luca Ceresoli
2022-05-11  6:54   ` Stefan Herbrechtsmeier

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=7c6d7c1c-d449-e4a2-6773-bc49ee2983b4@windriver.com \
    --to=mark.asselstine@windriver.com \
    --cc=alex.kanavin@gmail.com \
    --cc=lukas.funke@weidmueller.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=stefan.herbrechtsmeier-oss@weidmueller.com \
    --cc=stefan.herbrechtsmeier@weidmueller.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox