Skip to content

Conversation

@WangWeiLin-MV
Copy link
Contributor

@WangWeiLin-MV WangWeiLin-MV commented Oct 21, 2024

Fix end-to-end-tests.ps1, which should fail and stop with failure test case.

Change

@WangWeiLin-MV WangWeiLin-MV changed the title [e2e] Test end-to-end-tests.ps1 [e2e] end-to-end-tests.ps1 should fail with failure test Oct 21, 2024
@WangWeiLin-MV WangWeiLin-MV changed the title [e2e] end-to-end-tests.ps1 should fail with failure test [pipeline/e2e] end-to-end-tests.ps1 should fail with failure test Oct 21, 2024
@WangWeiLin-MV
Copy link
Contributor Author

WangWeiLin-MV commented Oct 21, 2024

Test

Example of un-expected pass before fixed

Example of failed as expected after fixed

Example of error message Unexpected character; expected property name in GitHub action page

@BillyONeal
Copy link
Member

BillyONeal commented Oct 21, 2024

Fix end-to-end-tests.ps1, which should fail and stop with failure test case.

As far as I can tell it already does this. Do you have a repro for it not doing so?

(EDIT: I see you have an example in a comment here but it's not clear how you got that to happen)

@BillyONeal
Copy link
Member

It looks like the repro might only happen with something like this "Pester" module ( as in #1512 ) because all other existing e2e tests fail by throwing an exception, thus stopping further test runs.

@WangWeiLin-MV
Copy link
Contributor Author

Fix end-to-end-tests.ps1, which should fail and stop with failure test case.

As far as I can tell it already does this. Do you have a repro for it not doing so?

(EDIT: I see you have an example in a comment here but it's not clear how you got that to happen)

Sorry I forgot to attach the test commit 7755480

Run this script with $ErrorActionPreference = "Stop", will get status $? to False and $LASTEXITCODE to 2.

BeforeAll {
    Import-Module $PSScriptRoot/not-exist/posh-vcpkg
}
Describe 'Module posh-vcpkg tests' {
    It 'Expect fail' {}
}

This issue has been fixed by:

  • Check $lastTextExitCode = $LASTEXITCODE
  • Reset $LASTEXITCODE for Throw-IfNotFailed

@WangWeiLin-MV
Copy link
Contributor Author

WangWeiLin-MV commented Oct 22, 2024

I'm now trying to fix the error message Unexpected character; expected property name in GitHub action page, for example https://github.com/microsoft/vcpkg-tool/actions/runs/11450810448

Update: Fixed by adding Remove-Problem-Matchers and Restore-Problem-Matchers


P.S.

The command vcpkg x-ci-verify-versions return 0 and output error message to stdout instead of stderr for azure-pipelines\e2e-assets\ci-verify-versions-registry\ports\malformed\vcpkg.json.

@WangWeiLin-MV
Copy link
Contributor Author

WangWeiLin-MV commented Oct 22, 2024

Unable change runner machine runs-on from macos-12 to macos-14, even there aren't any build macos-12 string in the repository.

It hangs with PR check:

builds / build (macos-12, macos-ci) Expected — Waiting for status to be reported

Update:

It might be waiting the branch protection Rulesets - Require status checks to pass, changing machine caused the job name to change.

As a transitional, add arm64 macos-14 and x86_64 macos-14-large job as an additional job instead of renaming the existing one.

https://github.com/actions/runner-images?tab=readme-ov-file#available-images


Update 2:

@WangWeiLin-MV WangWeiLin-MV marked this pull request as ready for review October 22, 2024 08:29
@WangWeiLin-MV WangWeiLin-MV marked this pull request as draft October 23, 2024 02:37
@WangWeiLin-MV
Copy link
Contributor Author

Note

vmImage: macOS-12 is deprecated in azure-pipelines/signing.yml:208

https://devblogs.microsoft.com/devops/upcoming-deprecation-of-macos-12-hosted-pipeline-image/

@WangWeiLin-MV WangWeiLin-MV marked this pull request as draft November 20, 2024 03:04
@WangWeiLin-MV
Copy link
Contributor Author

Test

Expected fail with failed test case https://github.com/microsoft/vcpkg-tool/actions/runs/11925979891

@WangWeiLin-MV WangWeiLin-MV marked this pull request as ready for review November 20, 2024 03:55
@BillyONeal BillyONeal merged commit b8680ed into microsoft:main Nov 27, 2024
6 checks passed
@BillyONeal
Copy link
Member

Thanks!

@WangWeiLin-MV WangWeiLin-MV deleted the e2e/fix-case-error-forwarding branch November 27, 2024 03:56
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.

2 participants