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

Update error message in LRT for bicep recipe language failure #7809

Closed
1 task
sk593 opened this issue Aug 14, 2024 · 1 comment · Fixed by #7810
Closed
1 task

Update error message in LRT for bicep recipe language failure #7809

sk593 opened this issue Aug 14, 2024 · 1 comment · Fixed by #7810
Labels
bug Something is broken or not working as expected

Comments

@sk593
Copy link
Contributor

sk593 commented Aug 14, 2024

Steps to reproduce

There's a failure in the LRT due to a mismatch in the error message in a negative test. The mismatch is due to the length of characters used in the version number for the recipe published. The test is coded to match the number of characters in the functional test (i.e. pr-func#) but the LRT use "latest" as the version number so there's an index mismatch

Observed behavior

=== FAIL: test/functional-portable/corerp/noncloud/resources Test_BicepRecipe_LanguageFailure/deploy_testdata/corerp-resources-recipe-bicep.bicep (17.98s)
    rptest.go:391: running step 0 of 1: deploy testdata/corerp-resources-recipe-bicep.bicep
    deployerrorexecutor.go:99: deploying deploy testdata/corerp-resources-recipe-bicep.bicep from file testdata/corerp-resources-recipe-bicep.bicep
2024/08/14 16:14:21 Start streaming Kubernetes logs - Pod postgres-58cf9b77d5-zjtvm is in state: Running
2024/08/14 16:14:21 Streaming Kubernetes logs to /home/runner/work/radius/radius/dist/container_logs/postgres-58cf9b77d5-zjtvm.postgres.log
    cli.go:394: [heartbeat] command rad deploy /home/runner/work/radius/radius/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-recipe-bicep.bicep --parameters registry=ghcr.io/radius-project/dev --parameters version=pr-longr74d4896a4f --parameters basename=corerp-resources-recipe-bicep-langugagefailure --parameters recipe=language-failure is still running after 10.000983409s
    cli.go:341: [rad] Building /home/runner/work/radius/radius/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-recipe-bicep.bicep...
    cli.go:341: [rad] WARNING: The following experimental Bicep features have been enabled: Extensibility, Dynamic type loading, Extension registry. Experimental features should be enabled for testing purposes only, as there are no guarantees about the quality or stability of these features. Do not enable these settings for any production usage, or your production environment may be subject to breaking.
    cli.go:341: [rad] Deploying template '/home/runner/work/radius/radius/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-recipe-bicep.bicep' into environment 'kind-radius' from workspace 'radlrtest00-aks-admin'...
    cli.go:341: [rad] 
    cli.go:341: [rad] Deployment In Progress...
    cli.go:341: [rad] 
    cli.go:341: [rad] Error: {
    cli.go:341: [rad]   "code": "DeploymentFailed",
    cli.go:341: [rad]   "message": "At least one resource deployment operation failed. Please see the details for the specific operation that failed.",
    cli.go:341: [rad]   "target": "/planes/radius/local/resourceGroups/kind-radius/providers/Microsoft.Resources/deployments/rad-deploy-4781[89](https://github.com/radius-project/radius/actions/runs/10391011928/job/28773108229#step:23:90)5a-bcc0-40ac-8ae2-720153d75253",
    cli.go:341: [rad]   "details": [
    cli.go:341: [rad]     {
    cli.go:341: [rad]       "code": "ResourceDeploymentFailure",
    cli.go:341: [rad]       "message": "Failed",
    cli.go:341: [rad]       "target": "/planes/radius/local/resourceGroups/kind-radius/providers/Applications.Core/extenders/corerp-resources-recipe-bicep-langugagefailure",
    cli.go:341: [rad]       "details": [
    cli.go:341: [rad]         {
    cli.go:341: [rad]           "code": "RecipeDeploymentFailed",
    cli.go:341: [rad]           "message": "failed to deploy recipe default of type Applications.Core/extenders",
    cli.go:341: [rad]           "details": [
    cli.go:341: [rad]             {
    cli.go:341: [rad]               "code": "DeploymentFailed",
    cli.go:341: [rad]               "message": "At least one resource deployment operation failed. Please see the details for the specific operation that failed.",
    cli.go:341: [rad]               "target": "/planes/radius/local/resourceGroups/kind-radius/providers/Microsoft.Resources/deployments/recipe17236520626261[91](https://github.com/radius-project/radius/actions/runs/10391011928/job/28773108229#step:23:92)598",
    cli.go:341: [rad]               "details": [
    cli.go:341: [rad]                 {
    cli.go:341: [rad]                   "code": "InvalidTemplate",
    cli.go:341: [rad]                   "message": "Unable to process template language expressions for resource 'Applications.Core/extenders/corerp-resources-recipe-bicep-langugagefailure-failure' at line '1' and column '445'. 'Unable to evaluate the template language function 'substring'. The index parameter cannot be larger than the length of the string. The index parameter: '10', the length of the string parameter: '4'. Please see https://aka.ms/arm-function-substring for usage details.'",
    cli.go:341: [rad]                   "target": "/planes/radius/local/resourceGroups/kind-radius/providers/Applications.Core/extenders/corerp-resources-recipe-bicep-langugagefailure-failure",
    cli.go:341: [rad]                   "additionalInfo": [
    cli.go:341: [rad]                     {
    cli.go:341: [rad]                       "type": "TemplateViolation",
    cli.go:341: [rad]                       "info": {
    cli.go:341: [rad]                         "lineNumber": 1,
    cli.go:341: [rad]                         "linePosition": 445,
    cli.go:341: [rad]                         "path": ""
    cli.go:341: [rad]                       }
    cli.go:341: [rad]                     }
    cli.go:341: [rad]                   ]
    cli.go:341: [rad]                 }
    cli.go:341: [rad]               ]
    cli.go:341: [rad]             }
    cli.go:341: [rad]           ]
    cli.go:341: [rad]         }
    cli.go:341: [rad]       ]
    cli.go:341: [rad]     },
    cli.go:341: [rad]     {
    cli.go:341: [rad]       "code": "OK",
    cli.go:341: [rad]       "message": "",
    cli.go:341: [rad]       "target": "/planes/radius/local/resourceGroups/kind-radius/providers/Applications.Core/environments/corerp-resources-recipe-bicep-langugagefailure"
    cli.go:341: [rad]     },
    cli.go:341: [rad]     {
    cli.go:341: [rad]       "code": "OK",
    cli.go:341: [rad]       "message": "",
    cli.go:341: [rad]       "target": "/planes/radius/local/resourceGroups/kind-radius/providers/Applications.Core/applications/corerp-resources-recipe-bicep-langugagefailure"
    cli.go:341: [rad]     }
    cli.go:341: [rad]   ]
    cli.go:341: [rad] }
    cli.go:341: [rad] 
    cli.go:341: [rad] TraceId:  36998a593c1411d7f5edeceb7e102e0e
    cli.go:341: [rad] 
    cli.go:341: [rad] 
    deployerrorexecutor.go:157: 
        	Error Trace:	/home/runner/work/radius/radius/test/step/deployerrorexecutor.go:157
        	            				/home/runner/work/radius/radius/test/step/deployerrorexecutor.go:107
        	            				/home/runner/work/radius/radius/test/rp/rptest.go:3[92](https://github.com/radius-project/radius/actions/runs/10391011928/job/28773108229#step:23:93)
        	Error:      	failed to find a matching error detail
        	Test:       	Test_BicepRecipe_LanguageFailure/deploy_testdata/corerp-resources-recipe-bicep.bicep
    --- FAIL: Test_BicepRecipe_LanguageFailure/deploy_testdata/corerp-resources-recipe-bicep.bicep (17.98s)
Screenshot 2024-08-14 at 3 13 25 PM

Desired behavior

Update the test to either check for the specific index or to ignore the index and shorten the message that gets validated

Workaround

No response

rad Version

GH action run

Operating system

No response

Additional context

No response

Would you like to support us?

  • Yes, I would like to support you

AB#12968

@sk593 sk593 added the bug Something is broken or not working as expected label Aug 14, 2024
@radius-triage-bot
Copy link

👋 @sk593 Thanks for filing this bug report.

A project maintainer will review this report and get back to you soon. If you'd like immediate help troubleshooting, please visit our Discord server.

For more information on our triage process please visit our triage overview

sk593 added a commit that referenced this issue Aug 14, 2024
# Description

This updates the error message checked in the bicep language failure
check. There's a character mismatch in the two templates that get
deployed in the func tests vs the LRT. The error message is coded
towards the func tests so the character mismatch causes the LRT to fail

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #7809

---------

Signed-off-by: sk593 <[email protected]>
Reshrahim pushed a commit to Reshrahim/radius that referenced this issue Aug 27, 2024
# Description

This updates the error message checked in the bicep language failure
check. There's a character mismatch in the two templates that get
deployed in the func tests vs the LRT. The error message is coded
towards the func tests so the character mismatch causes the LRT to fail

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: radius-project#7809

---------

Signed-off-by: sk593 <[email protected]>
Signed-off-by: Reshma Abdul Rahim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken or not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant