p2panda / aquadoggo

Node for the p2panda network handling validation, storage, aggregation and replication
GNU Affero General Public License v3.0
69 stars 5 forks source link

Proptests failure case: invalid field type #520

Closed sandreae closed 1 year ago

sandreae commented 1 year ago

Needs a little more investigating as not clear on first look if this is a bug in the test logic or our code

thread 'proptests::tests::filtering_queries' panicked at 'Publish CREATE operation: ValidateOperationError(SchemaValidation(InvalidField("f", "invalid field type 'str[][]', expected 'pinned_relation(test_schema_0020dc84e4edf7556b7f04b5818bd6fd168dafb34ef03253822c20dabe4b9e3253de)'")))', aquadoggo/src/test_utils/node.rs:145:10
proptest: Aborting shrinking after the PROPTEST_MAX_SHRINK_ITERS environment variable or ProptestConfig.max_shrink_iters iterations (set 400 to a large(r) value to shrink more; current configuration: 400 iterations)
proptest: Saving this and future failures in /home/runner/work/aquadoggo/aquadoggo/aquadoggo/proptest-regressions/proptests/tests.txt
proptest: If this test was run on a CI system, you may wish to add the following line to your copy of the file. (You may need to create it.)
cc 1e08b8b626823dfd7f2cf6d3598efa0d518e0259f8f000e1e46e7c1ae4d286c2
thread 'proptests::tests::filtering_queries' panicked at 'Test failed: Publish CREATE operation: ValidateOperationError(SchemaValidation(InvalidField("f", "invalid field type 'str[][]', expected 'pinned_relation(test_schema_0020dc84e4edf7556b7f04b5818bd6fd168dafb34ef03253822c20dabe4b9e3253de)'"))).
minimal failing input: (schema_ast, document_ast_collection, application_field_filters,
_meta_field_filters) = (
    SchemaAST {
        name: SchemaName(
            "test_schema",
        ),
        description: SchemaDescription(
            "My test schema",
        ),
        id: Application(
            SchemaName(
                "test_schema",
            ),
            DocumentViewId(
                [
                    OperationId(
                        Hash(
                            "0020a0c5cfc993a38f645b60e4b421a561dfd373474457be21874624626334eae64a",
                        ),
                    ),
                ],
            ),
        ),
        fields: [
            SchemaField {
                name: FieldName(
                    "f",
                ),
                field_type: PinnedRelationList,
                relation_schema: Some(
                    SchemaAST {
                        name: SchemaName(
                            "test_schema",
                        ),
                        description: SchemaDescription(
                            "My test schema",
                        ),
                        id: Application(
                            SchemaName(
                                "test_schema",
                            ),
                            DocumentViewId(
                                [
                                    OperationId(
                                        Hash(
                                            "002047b6aa585186677d07b6ae1ec624146714132f45fd01211f6dce37b3253e5fe7",
                                        ),
                                    ),
                                ],
                            ),
                        ),
                        fields: [
                            SchemaField {
                                name: FieldName(
                                    "gi3_4DoL_AqunXeU3R4TOIw_u09in_pgRERE_p9_H_UmC4x1Si_4Mc_G4",
                                ),
                                field_type: Boolean,
                                relation_schema: None,
                            },
                        ],
                    },
                ),
            },
            SchemaField {
                name: FieldName(
                    "BlQIDw3_7ZsJcrNamH3oNFzr8iIQ3oktMbHaO__Q_2kw_qK_U6Mj_5_h_910dvgM",
                ),
                field_type: Boolean,
                relation_schema: None,
            },
            SchemaField {
                name: FieldName(
                    "f",
                ),
                field_type: PinnedRelation,
                relation_schema: Some(
                    SchemaAST {
                        name: SchemaName(
                            "test_schema",
                        ),
                        description: SchemaDescription(
                            "My test schema",
                        ),
                        id: Application(
                            SchemaName(
                                "test_schema",
                            ),
                            DocumentViewId(
                                [
                                    OperationId(
                                        Hash(
                                            "0020dc84e4edf7556b7f04b5818bd6fd168dafb34ef03253822c20dabe4b9e3253de",
                                        ),
                                    ),
                                ],
                            ),
                        ),
                        fields: [
                            SchemaField {
                                name: FieldName(
                                    "t4J46V",
                                ),
                                field_type: Boolean,
                                relation_schema: None,
                            },
                            SchemaField {
                                name: FieldName(
                                    "f_U_H3_urLmsl8E8DmQ7vM_",
                                ),
                                field_type: Integer,
                    value: RelationList(
                        [
                            DocumentAST {
                                schema_id: Application(
                                    SchemaName(
                                        "test_schema",
                                    ),
                                    DocumentViewId(
                                        [
                                            OperationId(
                                                Hash(
                                                    "0020083e3327f20f45e7d48dbb55d95b0b2ab1ff7796fca8f8d65caf98e368927d32",
                                                ),
                                            ),
                                        ],
                                    ),
                                ),
                                fields: [
                                    DocumentFieldValue {
                                        name: FieldName(
                                            "D85mYx_2a0SdK8wR9DfP6_PbnnWD_hXdq95A0rt_",
                                        ),
                                        value: Boolean(
                                            false,
                                        ),
                                    },
                                    DocumentFieldValue {
                                        name: FieldName(
                                            "yuW_zs7_1st5V_IZYfER_9LNW__4k77_kO9Bf",
                                        ),
                                        value: String(
                                            "$𝂪L𑈇\\G\u{17cd}&𑪰🂪5ഉ႖'{𝑮*𐌼./Ⱥ{",
                                        ),
                                    },
                                ],
                            },
                        ],
                    ),
                },
            ],
        },
    ],
    [
        (
            (
                FieldName(
                    "f",
                ),
                Equal(
                    UniqueIdentifier,
                ),
            ),
            [],
        ),
    ],
    [
        (
            DocumentId,
            Equal(
                UniqueIdentifier,
            ),
        ),
    ],
)
    successes: 49
    local rejects: 0
    global rejects: 0
', aquadoggo/src/proptests/tests.rs:188:1

failures:
    proptests::tests::filtering_queries

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 309 filtered out; finished in 52.39s
adzialocha commented 1 year ago

I've observed this one here as well, not sure if it is related? https://github.com/p2panda/aquadoggo/actions/runs/6076273746/job/16483981446

thread 'proptests::tests::pagination_queries' panicked at 'Test failed: Publish CREATE operation: ValidateOperationError(SchemaValidation(InvalidField("l", "invalid field type 'bool', expected 'float'"))).
adzialocha commented 1 year ago
proptest: Aborting shrinking after the PROPTEST_MAX_SHRINK_ITERS environment variable or ProptestConfig.max_shrink_iters iterations (set 400 to a large(r) value to shrink more; current configuration: 400 iterations)
proptest: Saving this and future failures in /home/runner/work/aquadoggo/aquadoggo/aquadoggo/proptest-regressions/proptests/tests.txt
proptest: If this test was run on a CI system, you may wish to add the following line to your copy of the file. (You may need to create it.)
cc fbee9a945cacb789fd5dc1fdbdbf1a79771eafecde5db920eba3aa7a31e951d0
thread 'proptests::tests::pagination_queries' panicked at 'Test failed: Generated schema is valid: SchemaFieldsError(DuplicateFields).
minimal failing input: (schema_ast, document_ast_collection) = (
    SchemaAST {
        name: SchemaName(
            "test_schema",
        ),
        description: SchemaDescription(
            "My test schema",
        ),
        id: Application(
            SchemaName(
                "test_schema",
            ),
            DocumentViewId(
                [
                    OperationId(
                        Hash(
                            "00209b9a2e1d1544a30cc0f58ba7ae186524aa5c1ffa288f7a1c8a545eeb0777f0fa",
                        ),
                    ),
                ],
            ),
        ),
        fields: [
            SchemaField {
                name: FieldName(
                    "a",
                ),
                field_type: PinnedRelation,
                relation_schema: Some(
                    SchemaAST {
                        name: SchemaName(
                            "test_schema",
                        ),
                        description: SchemaDescription(
                            "My test schema",
                        ),
                        id: Application(
                            SchemaName(
                                "test_schema",
                            ),
                            DocumentViewId(
                                [
                                    OperationId(
                                        Hash(
                                            "00207a7295b13e85d57e33443efac56295b1a217a7ff9d3eb9155a6bd72c383815af",
                                        ),
                                    ),
                                ],
                            ),
                        ),
                        fields: [
                            SchemaField {
                                name: FieldName(
                                    "X",
                                ),
                                field_type: Boolean,
                                relation_schema: None,
                            },
                            SchemaField {
                                name: FieldName(
                                    "X",
                                ),
                                field_type: Integer,
                                relation_schema: None,
                            },
                            SchemaField {
                                name: FieldName(
                                    "PafIP_w4epm_9_vyP_82_EbPyRB29_DRLE_V19tgUQMwq",
                                ),
                                field_type: Boolean,
                                relation_schema: None,
                            },
                            SchemaField {
                                name: FieldName(
                                    "OggtKiZqyQE_S_Ckqw45KK9RC78SiCdzeW",
                                ),
                                field_type: Float,
                                relation_schema: None,
                            },
                            SchemaField {
                                name: FieldName(
                                    "n__1SJG6_P9A79lifH7SpUsd27SpC6KXgwM37m_g",
                                ),
                                field_type: Float,
                                relation_schema: None,
                            },
                            SchemaField {
                                name: FieldName(
                                    "c_UBi_L_0m8i81Am0O725n4__M_10EK0",
                                ),
                                field_type: Float,
                                relation_schema: None,
                            },
                            SchemaField {
                                name: FieldName(
                                    "G__vnqjAeh68F65rRqa1_rr5507TSJT_NSz0v__LnA",
                                ),
                                field_type: Integer,
                                relation_schema: None,
                            },
                        ],
                    },
                ),
            },
        ],
    },
    [],
)
    successes: 32
    local rejects: 0
    global rejects: 0
', aquadoggo/src/proptests/tests.rs:188:1