Skip to content

Fix up powershell scripts#454

Merged
jonfortescue merged 11 commits intomasterfrom
FixupPowershell
Jul 1, 2019
Merged

Fix up powershell scripts#454
jonfortescue merged 11 commits intomasterfrom
FixupPowershell

Conversation

@jonfortescue
Copy link
Copy Markdown
Contributor

A few modifications to the powershell scripts to bring them up to standards

@ghost
Copy link
Copy Markdown

ghost commented Jun 7, 2019

Looks good! these tests need a lot of setup to run locally so let me run a quick test to see if everything keeps working fine.

@ghost
Copy link
Copy Markdown

ghost commented Jun 7, 2019

This breaks Darc-Command-Impl :(

Write-Host "Running 'darc $darcParams $darcAuthParams'"
$darcCommand = "`$commandOutput = $baseDarcCommand $darcAuthParams; if (`$LASTEXITCODE -ne 0) { Write-Host `${commandOutput};throw `"Darc command exited with exit code: `$LASTEXITCODE`" } else { `$commandOutput }"
Invoke-Expression $darcCommand
$commandOutput = & $darcTool $darcParams $darcAuthParams; if ($LASTEXITCODE -ne 0) { Write-Host ${commandOutput};throw "Darc command exited with exit code: $LASTEXITCODE" } else { $commandOutput }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verb 'add-channel --name '658958354' --classification 'test'' is not recognized.
The " from $darcParams seem to be getting passed along, making it so it looks like the command is the entire string.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember why I wrote it like that originally, but there may have been a fair bit of trial and error there related to quoting semantics and such. This needs some local testing prior to check-in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I'll be making sure to figure out this quote stuff.

Copy link
Copy Markdown
Member

@mmitche mmitche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test before checking in.

@jonfortescue jonfortescue self-assigned this Jun 10, 2019
@jonfortescue
Copy link
Copy Markdown
Contributor Author

@riarenas Tests are flaky but I'm able to get all of them to pass locally. You good with merging this?

@ghost
Copy link
Copy Markdown

ghost commented Jul 1, 2019

I tried running channels.ps1, and got:

fail: Microsoft.DotNet.Darc.Operations.Operation[0]       Could not find channel with name '238743518'
WARNING: Failed to delete channel 238743518
WARNING: Darc command exited with exit code: 42

During the final teardown function.
This means we are leaking test channels every time we run the test. More single quote issues 😢

EDIT: aaaand that's totally expected because the channel tests delete the channels they create as part of the test. Nothing to see here.

Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for iterating on this Jon!

(make sure to squash merge)

@jonfortescue jonfortescue merged commit 7db02d8 into master Jul 1, 2019
@jonfortescue jonfortescue deleted the FixupPowershell branch July 1, 2019 22:28
@ghost
Copy link
Copy Markdown

ghost commented Jul 2, 2019

Hey @jonfortescue, the tests are failing consistently after this PR merged. It's not flakiness. (also, you didn't squash merge :( )

@ghost
Copy link
Copy Markdown

ghost commented Jul 2, 2019

The azdoflow-nonbatched-all-checks-successful test is broken because the merge policy is getting generated incorrectly.

"mergePolicies": [
      {
        "name": "AllChecksSuccessful",
        "properties": {
          "ignoreChecks": [
            "'Work",
            "item",
            "linking'"
          ]
        }

should look like this:

"mergePolicies": [
      {
        "name": "AllChecksSuccessful",
        "properties": {
          "ignoreChecks": [
            "Work item linking"
          ]
        }

The args are getting split by spaces. This is the one place where we don't want that. This is causing the PRs opened by the test to not be merged because the IgnoreChecks are not correct. The Github allChecksSuccessful is working because the ignoreCheck for that one does not include spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants