Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99155 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38890 invoked from network); 24 May 2017 18:06:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2017 18:06:46 -0000 Authentication-Results: pb1.pair.com header.from=sammyk@sammykmedia.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=sammyk@sammykmedia.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sammykmedia.com designates 209.85.213.45 as permitted sender) X-PHP-List-Original-Sender: sammyk@sammykmedia.com X-Host-Fingerprint: 209.85.213.45 mail-vk0-f45.google.com Received: from [209.85.213.45] ([209.85.213.45:33922] helo=mail-vk0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B6/DE-10292-4BBC5295 for ; Wed, 24 May 2017 14:06:45 -0400 Received: by mail-vk0-f45.google.com with SMTP id y190so80066939vkc.1 for ; Wed, 24 May 2017 11:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sammykmedia-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=Bak9+b382iwWVoXBAeUbzE4NsC9h/MSC0XL1K+NreDQ=; b=IGZzErV775uXT3Mf0GDZajaIAaDmukE+RtAzNNfEwThbRIQMpkXrxFKukNCcd3vFlH V5iyyDD9eaAjfPQmPUMtzuK3e47LkYhCLfqJE+XpPl8L1zu8UCJcVfAKcP3tqIHJEzkJ IVEbyllkars1895cjXHsueGk4dyamLr+ckUTf7X/anjz1Gn3nwmuORO1bWxDk/fxstj/ eQBQSf4LSIwBvuyER+OP8xQLbdGPJ565i6tJF9WWo2izmSTGKk6F8n8oKHkohsIRylbg Hjh4+3tu6enm6bHawHh6zeOSohW3+9fD7KNfeh6oCUxmRinduv+ZFz5knojjNRA5QDRt xQwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=Bak9+b382iwWVoXBAeUbzE4NsC9h/MSC0XL1K+NreDQ=; b=PNNtJjHgvu7F5AdePjZYc6ZUN1qV71wNdEWEsG0mkbtv9LqH7SvfS21MsI8PqDEbjB P7KE9ugJl8Am34/YBDuy1ACyOlnCgbA4XtYI55c0W78cwFtvwVB/3hewvZzoawPETzW0 rlpU+NE+2Jg7Ilcc2GdPMKgkMtt8GBwxnqh+KemT7OKJ6yW0OHZMcrKQkPBV2zyXzLdW VY5ATOz+WCengrgX/KpeuRPWbkqRiYdZiLl13EUJ67cVAJUeiFb5dWEngVUkJcXAAzxE mjv0ZdC5+zndv4FPDrJ5fKwPYZfA3p4MjophUujlZ0nHileK1gIbyEeoAAabXisdO/Ov y6Aw== X-Gm-Message-State: AODbwcAFZBvMYVisMeefld5FkWarQScNhWSI3bW6nmg98mCn2hYJrozY bnpw2TngKVBVi/eIJblK4halmxR+kVaT X-Received: by 10.31.165.79 with SMTP id o76mr15602936vke.91.1495649202037; Wed, 24 May 2017 11:06:42 -0700 (PDT) MIME-Version: 1.0 Sender: sammyk@sammykmedia.com Received: by 10.31.252.135 with HTTP; Wed, 24 May 2017 11:06:41 -0700 (PDT) X-Originating-IP: [209.156.3.101] In-Reply-To: References: Date: Wed, 24 May 2017 13:06:41 -0500 X-Google-Sender-Auth: Gr614z9a1FKdWJJIbw9hF6Gv9_k Message-ID: To: Anatol Belski Cc: PHP Internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Implement formal process for run-tests.php refactor From: me@sammyk.me (Sammy Kaye Powers) On Thu, May 18, 2017 at 5:59 AM, Anatol Belski wrote: > > Hi Sammy, > > > -----Original Message----- > > From: sammyk@sammykmedia.com [mailto:sammyk@sammykmedia.com] On > > Behalf Of Sammy Kaye Powers > > Sent: Wednesday, May 17, 2017 4:29 PM > > To: PHP Internals > > Subject: [PHP-DEV] Implement formal process for run-tests.php refactor > > > > Hello internals folks! > > > > As you may already know, run-tests.php is an old legacy app that is in = serious > > need of a refactor. Some things that are badly needed amongst other thi= ngs are: > > > > - Better maintainability > > - Unit tests > > - Concurrency > > - Prettier output > > > > I have seen numerous attempts of rewriting run-tests from scratch after= some > > rallying at a UG or PHP conference only to see the initial excitement d= ie off. The > > general advice for refactoring legacy apps is to not start with a clean= slate, > > rather refactor a little bit at a time. We should treat run-tests as we= would any > > other legacy app. > > > > We need a structured process to allow the run-tests app to get refactor= ed a > > little bit at a time. I propose the following (open to discussion of co= urse). > > > > 1) Create a new run-tests karma with access to php-src.git/run-tests.ph= p (and > > hopefully the soon-to-be created php-src.git/run-tests folder). > > > > 2) Elect 2-3 people and grant the new run-tests karma to them. They wil= l > > champion the PR's that incrementally improve run-tests. > > > > 3) The new run-tests champions (we'll call them "champions" because, wh= y > > not?) will run the entire test suite ensuring that the refactor didn't = inadvertently > > break the functionality and if all good, merge. (We might be able to ge= t a solid > > Docker container or an automated CI process for an end-to-end test - > > thoughts?) > > > > 4) The run-tests champions could be elected for a year-long term with t= he > > possibility of being reelected for another year commitment. This would = help > > prevent run-test champion drop-off (because sometimes, life happens). > > > > Once we get a process in place, I've drafted up a possible proposal of = next steps > > to get run-tests refactoring kicked off: > > > > https://github.com/SammyK/run-tests#proposed-refactoring-path > > > > It's time to circle the wagons on run-tests! :) > > > That's a fair amount on pre evaluation already =F0=9F=98=89. > > AFM, the parallelism is the most wanted feature that would improve QA a l= ot, so that is what should stand in the foreground. Having a better structu= red app might help on it, yes, but having the parallelism to be targeted "s= ome when" is probably not a good sign. Otherwise, an nice app with colors a= nd styles, etc. would be indeed nice but less helpful, IMHO, as the current= run-tests.php is great for simplicity and still maintainable well. > > I would suggest therefore, to put the harder goals into the foreground, a= s that would require and warrant a certain rewrite. It's not for nothing, t= hat previous rewrite attempts targeting similar things was abandoned previo= usly, and it's probably not wise to allow for the same mistakes. I'd see as= first step an app that > > - is a very minimal rewrite of run-tests.php, made OO and whatsoever > - mimics all the existing features and options, but only them > - has as less dependencies as possible, be it PHP extensions or PHP code = itself, best requires pure core only > - is compatible with the current test format > - is able to run tests in parallel > - some simple tests are ported for parallel runs already > > I'd see such a bare app first developed as a pull request, agreed upon so= then run-tests.php is completely replaced by it. Then where the main work = can begin - the most of it will be anyway not the app itself, but the porti= ng of the existing tests. The required karma would include the app itself, = ext/*/tests, Zend/tests, tests, and other related areas. Perhaps, the tests= able to run in parallel can be marked as such with a new section or alike.= There are probably thousands of tests that have to be touched to run in pa= rallel otherwise, be it DB tests utilizing same table name or built-in serv= er based tests that want to occupy same port. If there were such an app mer= ged into master, that supports current test format and can run a mix of tes= ts in old/new ways, it'd allow an organic integration and step-by-step impr= ovement of the test suite. Then also, the other features from your evaluati= on could be developed while the test porting work is being done. > > Thanks > > Anatol > > Hey Anatol! I agree that parallelism should be the first and primary goal of the refactor. I just mentioned maintainability and unit tests first since I foresee those things happing as we refactor to parallelism. :) I'm OK doing a very minimal "proof-of-concept" project that would showcase a possible concurrency model so that we could discuss the tradeoffs of the implementation details in more depth. But after we agree on an implementation, I don't think we need to merge it directly, instead we should make small refactorings of the live run-tests.php that would eventually guide it toward the agreed-upon proof-of-concept implementation. As far as tests that can't be run in parallel, we could look to HHVM which checks for an empty file with the same name as the test file with the ".serial" extension. If it finds that, the test is put into a special "run in serial" bucket. I know make has a ".NOTPARALLEL" target to specify that things should be run serially. We could also have a new section in the .phpt file "--NOTPARALLEL--" or a tag similar to =3D=3D=3DDONE=3D=3D=3D so it's not parsed as a section: "=3D=3D=3DNOTPARALLEL=3D=3D=3D". At any rate, we'll need to decide on somet= hing but I think an empty ".serial" file makes a lot of sense. :) What would you say would be good next steps? Should I draft up a more formal process in the WIKI so we can discuss specifics further? https://wiki.php.net/qa/runtests