Follow-up from "Testing on windows with vagrant"
The following discussions from !1003 (merged) should be addressed:
-
@steveazz started a discussion: Would it be possible to just run
powershell ci\test_windows.ps1
here instead? Just like what we do in the vagrant box or am I misunderstanding something here? -
@steveazz started a discussion: (+1 comment) I ran PSScriptAnalyzer and got the following errors:
RuleName Severity ScriptName Line Message -------- -------- ---------- ---- ------- PSAvoidUsingCmdletAliases Warning test_windo 5 '%' is an alias of 'ForEach-Object'. Alias can introduce ws.ps1 possible problems and make scripts hard to maintain. Please consider changing alias to its full content. PSAvoidUsingInvokeExpression Warning test_windo 7 Invoke-Expression is used. Please remove Invoke-Expression ws.ps1 from script and find other options instead. PSAvoidUsingWriteHost Warning test_windo 12 File 'test_windows.ps1' uses Write-Host. Avoid using ws.ps1 Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. PSAvoidUsingWriteHost Warning test_windo 13 File 'test_windows.ps1' uses Write-Host. Avoid using ws.ps1 Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.
I am not sure what is the best way around
PSAvoidUsingInvokeExpression
reading https://blogs.msdn.microsoft.com/powershell/2011/06/03/invoke-expression-considered-harmful/ & https://powershellstation.com/2015/12/09/code-smell-invoke-expression/ maybe using&
is our best option here but I have not tested this yet. -
@steveazz started a discussion: (+1 comment) !1165 (merged) Any particular reason we put this vagrant provisioning script under the
ci
directory? Would it maybe make more sense underscripts/vagnrat/provision.ps1
? -
@steveazz started a discussion: (+1 comment) I ran PSScriptAnalyzer as a static checker purely because I am not that experiences with PowerShell so don't know the in and outs of it. When running it I got the following error messages which we might want to follow to start using some kind of standards.
PS C:\Go\src\gitlab.com\gitlab-org\gitlab-runner\ci> Invoke-ScriptAnalyzer vagrant.ps1 RuleName Severity ScriptName Line Message -------- -------- ---------- ---- ------- PSAvoidUsingCmdletAliases Warning vagrant.ps 67 '?' is an alias of 'Where-Object'. Alias can introduce 1 possible problems and make scripts hard to maintain. Please consider changing alias to its full content. PSAvoidUsingWriteHost Warning vagrant.ps 20 File 'vagrant.ps1' uses Write-Host. Avoid using Write-Host 1 because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. PSAvoidUsingWriteHost Warning vagrant.ps 32 File 'vagrant.ps1' uses Write-Host. Avoid using Write-Host 1 because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. PSAvoidUsingWriteHost Warning vagrant.ps 43 File 'vagrant.ps1' uses Write-Host. Avoid using Write-Host 1 because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. PSAvoidUsingWriteHost Warning vagrant.ps 51 File 'vagrant.ps1' uses Write-Host. Avoid using Write-Host 1 because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. PSAvoidUsingWriteHost Warning vagrant.ps 57 File 'vagrant.ps1' uses Write-Host. Avoid using Write-Host 1 because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. PSAvoidUsingWriteHost Warning vagrant.ps 69 File 'vagrant.ps1' uses Write-Host. Avoid using Write-Host 1 because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. PSAvoidUsingWriteHost Warning vagrant.ps 75 File 'vagrant.ps1' uses Write-Host. Avoid using Write-Host 1 because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. PSAvoidUsingWriteHost Warning vagrant.ps 78 File 'vagrant.ps1' uses Write-Host. Avoid using Write-Host 1 because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. PSAvoidUsingWriteHost Warning vagrant.ps 91 File 'vagrant.ps1' uses Write-Host. Avoid using Write-Host 1 because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. PSAvoidUsingWriteHost Warning vagrant.ps 99 File 'vagrant.ps1' uses Write-Host. Avoid using Write-Host 1 because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. PSUseApprovedVerbs Warning vagrant.ps 103 The cmdlet 'Log-File' uses an unapproved verb.
-
@steveazz started a discussion: (+1 comment) Is it worth adding checksum validation when downloading the go version? The same cloud be said for
Install-Git
not sure if it's worth the effort since this is for a development environment. I also don't mind having this in a sperate environment. -
@steveazz started a discussion: (+4 comments) !1165 (merged) @nolith I am curious as to why we decided to go with windows 10. I imagine the runner will run on a windows server. For example, we can test out https://app.vagrantup.com/StefanScherer/boxes/windows_2019_docker which will have docker installed as well. This will help us since we would be closer to a production environment for the runner on windows.
I know that the docker version that is included is not supported since it's a new version to what we support we have to update that anyways.
What do you think?
-
@steveazz started a discussion: Also note that the tests failure message are like below
I am not sure why the vendor tests seem to be running as well and the reporting seem to be unintentional we should just list the packages that failed not the build directory, correct/?
Failed packages gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/apps/gitlab-runner-helper gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/commands gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/commands/helpers gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/common gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/executors/docker gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/executors/docker/machine gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/executors/kubernetes gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/executors/shell gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/helpers/archives gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/helpers/docker gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/helpers/service gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/log gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/network gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/vendor/cloud.google.com/go gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/vendor/cloud.google.com/go/bigquery gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/vendor/cloud.google.com/go/bigquery/datatransfer/apiv1 gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/vendor/cloud.google.com/go/bigtable gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/vendor/cloud.google.com/go/bigtable/bttest gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/vendor/cloud.google.com/go/bigtable/cmd/cbt gitlab.com/gitlab-org/gitlab-runner/builds/V_YtMABN/0/root/submodules/gitlab-runner/vendor/cloud.google.com/go/bigtable/cmd/emulator