Bug 231374

Summary: [webkitperl] Fix webkitperl on Windows
Product: WebKit Reporter: Basuke Suzuki <Basuke.Suzuki>
Component: Tools / TestsAssignee: Basuke Suzuki <Basuke.Suzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: Basuke.Suzuki, ews-watchlist, Hironori.Fujii, jbedard, stephan.szabo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 231869    
Attachments:
Description Flags
PATCH
none
PATCH
none
PATCH
none
patch none

Description Basuke Suzuki 2021-10-07 10:35:14 PDT
Some tests are failed because of the handling of environment variables.
Comment 1 Basuke Suzuki 2021-10-07 11:31:24 PDT
Created attachment 440516 [details]
PATCH
Comment 2 Basuke Suzuki 2021-10-07 12:31:16 PDT
Created attachment 440524 [details]
PATCH
Comment 3 Basuke Suzuki 2021-10-07 12:34:49 PDT
Created attachment 440526 [details]
PATCH
Comment 4 Stephan Szabo 2021-10-07 13:06:10 PDT
Comment on attachment 440526 [details]
PATCH

View in context: https://bugs.webkit.org/attachment.cgi?id=440526&action=review

> Tools/Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl:703
> +        $ENV{RC_ProjectSourceVersion} = $testCase->{'RC_ProjectSourceVersion'};

I think if you're going to set our ENV like this, you'll need to reset it between tests, otherwise values will leak from test to test (or doing something more complicated that will only set the env in the created shell).

> Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/generateFunctionLists.pl:508
> +    plan skip_all => 'Please add `pathc` to the $PATH';

Nitpick: pathc -> patch
Comment 5 Fujii Hironori 2021-10-07 13:18:50 PDT
Comment on attachment 440526 [details]
PATCH

View in context: https://bugs.webkit.org/attachment.cgi?id=440526&action=review

> Tools/Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl:691
> +# Test can only be run if VersionStamper.exe exists

This comment doesn't match with the code. Which do yo want to check VersionStamper.exe or auto-version.pl here?

> Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/generateFunctionLists.pl:34
> +use VCSUtils;

Why do you need this change?

> Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/generateFunctionLists.pl:509
> +    exit 0;    

I think the test should fail if patch isn't found.
Comment 6 Basuke Suzuki 2021-10-07 13:59:40 PDT
Comment on attachment 440526 [details]
PATCH

View in context: https://bugs.webkit.org/attachment.cgi?id=440526&action=review

>> Tools/Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl:691
>> +# Test can only be run if VersionStamper.exe exists
> 
> This comment doesn't match with the code. Which do yo want to check VersionStamper.exe or auto-version.pl here?

Correct. Thanks.

>> Tools/Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl:703
>> +        $ENV{RC_ProjectSourceVersion} = $testCase->{'RC_ProjectSourceVersion'};
> 
> I think if you're going to set our ENV like this, you'll need to reset it between tests, otherwise values will leak from test to test (or doing something more complicated that will only set the env in the created shell).

I thought each test will be run in different process, but there seems no such assumption at all. I'll save and restore them at the end of each loop.

>> Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/generateFunctionLists.pl:34
>> +use VCSUtils;
> 
> Why do you need this change?

It was failed to load VCSUtils on the initial location. I bet this is related with the change on 5.26:
https://metacpan.org/pod/perl5260delta#Removal-of-the-current-directory-(%22.%22)-from-@INC

Anyway, it is dependent on the @INC so it is reasonable to move the usage bellow that.

>> Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/generateFunctionLists.pl:508
>> +    plan skip_all => 'Please add `pathc` to the $PATH';
> 
> Nitpick: pathc -> patch

Right.

>> Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/generateFunctionLists.pl:509
>> +    exit 0;    
> 
> I think the test should fail if patch isn't found.

Well, I want to hear the opinion from others.
Comment 7 Radar WebKit Bug Importer 2021-10-14 10:36:24 PDT
<rdar://problem/84262724>
Comment 8 Basuke Suzuki 2021-10-18 14:25:12 PDT
Created attachment 441640 [details]
patch
Comment 9 Basuke Suzuki 2021-10-18 14:26:50 PDT
Make `patch` required to run test.
Also environment variable is recovered after getting result from process invocation.
Comment 10 EWS 2021-10-18 15:21:12 PDT
Committed r284405 (?): <https://commits.webkit.org/r284405>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 441640 [details].