diff --git a/.github/workflows/test-ci.yaml b/.github/workflows/test-ci.yaml index 38130aac..77708764 100644 --- a/.github/workflows/test-ci.yaml +++ b/.github/workflows/test-ci.yaml @@ -36,7 +36,10 @@ jobs: shell: bash working-directory: ci/scripts run: | - echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV + url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX" + echo "IMAGE_TAG=$(curl -s $url | jq --arg TAG_PREFIX "$TAG_PREFIX" -r '."results"[] | select(.images[].architecture == "amd64" and (.name | contains("gpu") | not) and (.name | startswith($TAG_PREFIX))) | .name' | head -n 1)" >> $GITHUB_ENV +# echo "IMAGE_TAG=$(curl -s $url | jq -r '."results"[]["name"] | select(test("amd64$"))' | head -n 1)" >> $GITHUB_ENV +# echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV # export IMAGE_TAG=$IMAGE_TAG # export IMAGE_REPO=$IMAGE_REPO # export RELEASE_NAME=$RELEASE_NAME @@ -71,8 +74,8 @@ jobs: working-directory: test/ run: | nc -vz 127.0.0.1 19530 - curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v1.8.2/gotestsum_1.8.2_linux_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum - gotestsum --format testname --hide-summary=output ./testcases/... --tags L0 --addr=127.0.0.1:19530 -timeout=60m + curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v1.12.0/gotestsum_1.12.0_linux_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum + gotestsum --format testname --hide-summary=output --rerun-fails=2 ./testcases/... --tags L0 --addr=127.0.0.1:19530 -timeout=60m - name: Export logs if: ${{ !success() }} diff --git a/test/testcases/collection_test.go b/test/testcases/collection_test.go index 9ef77202..a3085f11 100644 --- a/test/testcases/collection_test.go +++ b/test/testcases/collection_test.go @@ -456,6 +456,37 @@ func TestCreateCollectionDynamicSchema(t *testing.T) { common.CheckContainsCollection(t, collections, collName) } +// test create collection enable dynamic field +func TestCreateCollectionDynamicSchemaOption(t *testing.T) { + ctx := createContext(t, time.Second*common.DefaultTimeout) + mc := createMilvusClient(ctx, t) + for _, enableDynamic := range [2]bool{true, false} { + collName := common.GenRandomString(6) + schema := entity.NewSchema().WithName(collName).WithDynamicFieldEnabled(enableDynamic) + for _, f := range common.GenDefaultFields(false) { + schema.WithField(f) + } + err := mc.CreateCollection(ctx, schema, common.DefaultShards, client.WithEnableDynamicSchema(!enableDynamic)) + common.CheckErr(t, err, true) + + // check describe collection + collection, _ := mc.DescribeCollection(ctx, collName) + common.CheckCollection(t, collection, collName, common.DefaultShards, schema, common.DefaultConsistencyLevel) + require.Truef(t, collection.Schema.EnableDynamicField, "Expected collection.Schema.EnableDynamicField is True") + + // check collName in ListCollections + collections, errListCollection := mc.ListCollections(ctx) + common.CheckErr(t, errListCollection, true) + common.CheckContainsCollection(t, collections, collName) + + // insert data + dp := DataParams{CollectionName: collName, PartitionName: "", CollectionFieldsType: Int64FloatVec, + start: 0, nb: common.DefaultNb, dim: common.DefaultDim, EnableDynamicField: true, WithRows: false} + _, err = insertData(ctx, t, mc, dp) + common.CheckErr(t, err, true) + } +} + // test create collection enable dynamic field by collection opt func TestCreateCollectionDynamic(t *testing.T) { t.Skip("Waiting for congqi to update schema.EnableDynamicField according to the CreateCollectionOption.EnableDynamicSchema")