Azure/azure-storage-cpp

What fields am I supposed to populate in test_configurations.json?

trevorwhitaker opened this issue · 9 comments

I am very new to Azure and cloud services in general. I am trying to experiment with this SDK to use in my application and am trying to get used to it. I'm trying to run the tests to make sure that I built the library correctly.

Looking at the README it says to fill in the test_configurations.json file but I don't know what should be filled in or how to obtain the info that should actually be in there. I signed up for the free Azure account and create a storage account but I don't see client_id, tenant_id or client secret anywhere in the console. Here is the config file:

{
  "target": "production",
  "premium_target": "premium_account",
  "blob_storage_target": "blob_storage_account",
  "tenants": [
    {
      "name": "devstore",
      "type": "devstore",
      "connection_string": "UseDevelopmentStorage=true"
    },
    {
      "name": "production",
      "type": "cloud",
      "connection_string": "DefaultEndpointsProtocol=https;"
    },
    {
      "name": "premium_account",
      "type": "cloud",
      "connection_string": "DefaultEndpointsProtocol=https;"
    },
    {
      "name": "blob_storage_account",
      "type": "cloud",
      "connection_string": "DefaultEndpointsProtocol=https;"
    }
  ],
  "token_information": {
    "account_name": "",
    "tenant_id": "",
    "client_id": "",
    "client_secret": "",
    "resource": "https://storage.azure.com"
  }
}

I created an Azure AD application and got the name/tenant_id/client_id/client_secret from that but my tests still fail. I assume I need to fill in the connection_string field too but checking my storage account I only see 1 connection string. Is this for blob_storage_account or do I use it for all connection strings above?

@trevorwhitaker

name Account Kind Performance/Access tier
production StorageV2 (general purpose v2) Standard/Hot
premium_account StorageV2 (general purpose v2) Premium/Hot
blob_storage_account BlobStorage Standard/Hot

@Jinming-Hu ok my problem was that I was using BlobStorage but didn't change the target. I created a new storage account for production and now I get 12 of 369 tests failed (62 failures). Is there anywhere that I can verify how many of these tests were clean in the latest release or if this is specific to my version? (I assume since only 12 failures I am fine but would like to compare).

The failures seem to be like

/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/cloud_blob_client_test.cpp:163:1: error: Failure in download_account_properties_service: (properties.sku_name() == _XPLATSTR("Premium_RAGRS")) || (properties.sku_name() == _XPLATSTR("Premium_LRS"))
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/cloud_blob_client_test.cpp:168:1: error: Failure in download_account_properties_service: properties.account_kind() == _XPLATSTR("BlobStorage")
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/cloud_blob_container_test.cpp:357:1: error: Failure in container_list_premium_blobs: Unhandled exception: The access tier is not supported for this blob type.
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/cloud_blob_test.cpp:734:1: error: Failure in blob_copy_with_premium_access_tier: Unhandled exception: The value for one of the HTTP headers is not in the correct format.
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/cloud_page_blob_test.cpp:914:1: error: Failure in page_blob_premium_tier: azure::storage::premium_blob_tier::p10 == m_blob.properties().premium_blob_tier()
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/cloud_page_blob_test.cpp:907:1: error: Failure in page_blob_premium_tier: Unhandled exception: The access tier is not supported for this blob type.
Blob:set_blob_tier_with_lease: test fixture client request ID: 761E5274-34D6-4408-A95F-DFD644681E94
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/cloud_page_blob_test.cpp:944:1: error: Failure in set_blob_tier_with_lease: azure::storage::premium_blob_tier::p10 == m_blob.properties().premium_blob_tier()
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/cloud_page_blob_test.cpp:937:1: error: Failure in set_blob_tier_with_lease: Unhandled exception: The access tier is not supported for this blob type.
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/cloud_storage_account_test.cpp:578:1: error: Failure in storage_credentials_oauth_operation: Unhandled exception: Error resolving address
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/cloud_storage_account_test.cpp:1019:1: error: Failure in account_sas_protocol: Unhandled exception: The account being accessed does not support http.
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/cloud_storage_account_test.cpp:1089:1: error: Failure in user_delegation_sas: Unhandled exception: Error resolving address
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/service_properties_test.cpp:111:1: error: Failure in table_service_properties: Expected 1 but was 0
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/service_properties_test.cpp:113:1: error: Failure in table_service_properties: Expected 1 but was 0
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/service_properties_test.cpp:114:1: error: Failure in table_service_properties: Expected 20 but was 0
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/service_properties_test.cpp:120:1: error: Failure in table_service_properties: Expected 0 but was 1
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/service_properties_test.cpp:123:1: error: Failure in table_service_properties: Expected 5 but was 7
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/service_properties_test.cpp:126:1: error: Failure in table_service_properties: Expected 1 but was 0
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/service_properties_test.cpp:129:1: error: Failure in table_service_properties: Expected 1 but was 0
/home/twhitake/azure-storage-cpp/Microsoft.WindowsAzure.Storage/tests/service_properties_test.cpp:145:1: error: Failure in table_service_properties: a_iter == a.cors().cend()
.
.
.

These seem to be probably related to my set up of the storage account and I think I can safely ignore and assume everything was built correctly, correct?

Thanks

@trevorwhitaker Yeah, I think it's fine. The test cases of this SDK hasn't been very stable.

@trevorwhitaker BTW, if you're starting a new project, I strongly recommend our new Track2 SDK. This sdk is gonna be deprecated soon.

@Jinming-Hu ok I will check that out. It looks like that new SDK doesn't have the Casablanca or libboost dependencies which would work out great too so I'll probably go with that. Thanks!

@Jinming-Hu the new SDK you linked looks like it is still in beta, is there any timeline on when a stable release will be created?

@Jinming-Hu the new SDK you linked looks like it is still in beta, is there any timeline on when a stable release will be created?

We're planning a stable release in May.

Awesome, thanks! Will be closing this issue now