Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pipeline/e2e] end-to-end-tests.ps1 should fail with failure test #1518

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

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 force-pushed the e2e/fix-case-error-forwarding branch 5 times, most recently from 86eeba9 to 7755480 Compare October 21, 2024 07:58
@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 force-pushed the e2e/fix-case-error-forwarding branch 2 times, most recently from adf8f06 to 29bce0b Compare October 21, 2024 08:44
@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

@WangWeiLin-MV WangWeiLin-MV force-pushed the e2e/fix-case-error-forwarding branch 6 times, most recently from 35a4312 to 4ecab71 Compare October 21, 2024 11:43
@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 force-pushed the e2e/fix-case-error-forwarding branch 3 times, most recently from d9d0cba to 50b6d36 Compare October 22, 2024 08:09
@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 ready for review October 23, 2024 03:01
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