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

Fix failing matrix-generator tests #5098

Open
konrad-jamrozik opened this issue Jan 9, 2023 · 0 comments
Open

Fix failing matrix-generator tests #5098

konrad-jamrozik opened this issue Jan 9, 2023 · 0 comments
Assignees
Labels
Central-EngSys This issue is owned by the Engineering System team.

Comments

@konrad-jamrozik
Copy link
Contributor

konrad-jamrozik commented Jan 9, 2023

A bug discovered while working on:

Located in:

azure-sdk-tools\eng\common-tests\matrix-generator\tests\job-matrix-functions.modification.tests.ps1

The bug is described in the header comment in the snippet below.

Snippet:

# This test is currently disabled (it doesn't have "UnitTest" tag) as it fails 
# in test "Should generate a sparse matrix where the entire base matrix is imported" on line:
#
#   $matrix = GenerateMatrix $importConfig "sparse"
#
# with message:
# 
#   ParameterBindingArgumentTransformationException: Cannot process argument transformation on parameter 'parameters'. Cannot convert the "System.Collections.Hashtable" value of type "System.Collections.Hashtable" to type "MatrixParameter".
#
# See full build failure:
# https://dev.azure.com/azure-sdk/internal/_build/results?buildId=2102328&view=logs&j=375fdae1-accf-5db0-5fc3-af258c8525cc&t=9e9d0eca-bdb6-593f-47d7-63cf69095eca&l=22
#
# Issue to track:
# https://github.com/Azure/azure-sdk-tools/issues/5098
Describe "Platform Matrix Import" -Tag "import" {
    It "Should generate a sparse matrix where the entire base matrix is imported" {
        $matrixJson = @'
{
    "matrix": {
        "$IMPORT": "./matrix-generator/tests/test-import-matrix.json"
    },
    "include": [
        {
            "fooinclude": "fooinclude"
        }
    ]
}
'@

        $expectedMatrix = @'
[
  {
    "parameters": { "Foo": "foo1", "Bar": "bar1" },
    "name": "foo1_bar1"
  },
  {
    "parameters": { "Foo": "foo2", "Bar": "bar2" },
    "name": "foo2_bar2"
  },
  {
    "parameters": { "Baz": "importedBaz" },
    "name": "importedBazName"
  },
  {
    "parameters": { "fooinclude": "fooinclude" },
    "name": "fooinclude"
  },
]
'@

        $importConfig = GetMatrixConfigFromJson $matrixJson
        $matrix = GenerateMatrix $importConfig "sparse"
        $expected = $expectedMatrix | ConvertFrom-Json -AsHashtable

        $matrix.Length | Should -Be 4
        CompareMatrices $matrix $expected
    }
@konrad-jamrozik konrad-jamrozik added the Central-EngSys This issue is owned by the Engineering System team. label Jan 9, 2023
@konrad-jamrozik konrad-jamrozik changed the title Fix failing matrix-generator tests Fix failing matrix-generator tests Jan 9, 2023
ghost pushed a commit that referenced this issue Jan 10, 2023
…ake the tests runnable by `common-tests/ci.yml`. (#5095)

This PR fixes paths I forgot to update when I did this PR:
- #5027

And as such this PR contributes to addressing:
- #4995

It also adds `UnitTest` tags to the `matrix-generator` tests so [`common-tests/ci.yml` pipeline](https://dev.azure.com/azure-sdk/internal/_build?definitionId=5809) executes them.

### Related work

- #5098
@konrad-jamrozik konrad-jamrozik removed their assignment Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Central-EngSys This issue is owned by the Engineering System team.
Projects
Status: 🤔 Triage
Development

No branches or pull requests

2 participants