karatelabs / karate

Test Automation Made Simple
https://karatelabs.github.io/karate
MIT License
8.09k stars 1.94k forks source link

Number of aliases for non-scalar nodes exceeds the specified max=50 #1491

Closed rodrigocal closed 10 months ago

rodrigocal commented 3 years ago

Hi, @ptrthomas we have inherited a big yml file with address data we use as db in our tests, with latest 0.9.9.RC4 we are getting this error (not with previous versions)

The errortrace that I get is like this :

* def addressData = read('test-data/static-data/addresses-data.yml')
>>>> js failed:
01: read('test-data/static-data/addresses-data.yml')
<<<<
org.graalvm.polyglot.PolyglotException: Number of aliases for non-scalar nodes exceeds the specified max=50
- org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:147)
- org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:257)
- org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:248)
- org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:236)
- org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:162)
- org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:209)
- org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)

myproject.zip

is there some way to configure this: "Number of aliases for non-scalar nodes exceeds the specified max=50"``

ptrthomas commented 3 years ago

@rodrigocal I have no idea and tagging as help wanted we just use the snakeyaml library (which was upgraded) and maybe that has a config setting. I think the best thing is for you to do some research on that and if you can contribute a PR, that is ideal - but if you at least figure out if it is a simple fix we can do it

joelpramos commented 3 years ago

https://github.com/jenkinsci/configuration-as-code-plugin/issues/1374#issuecomment-633307255

Try this and check whether the property and/or the environment property works. If it works might not be a bad idea to increase this default number within the karate framework itself.

ptrthomas commented 3 years ago

closing as wontfix but PR-s welcome

mguzelel commented 10 months ago

no fix or no help on this?

ptrthomas commented 10 months ago

@mguzelel I tried to set a system property like this:

class BugsRunnerTest {

    @Karate.Test
    Karate testBugs() {        
        return Karate                
                .run("classpath:examples/bugs/bugs.feature")
                .systemProperty("casc.yaml.max.aliases", "100");      
    }    

}

it didn't seem to work. since you are complaining, I have re-opened this. @mguzelel you or anyone else is welcome to try and fix this