Skip to content

Commit

Permalink
Fix azure_scope_and_full_path test to allow test with real storage ac…
Browse files Browse the repository at this point in the history
…count
  • Loading branch information
quentingodeau committed Mar 12, 2024
1 parent 905d7e0 commit 7990d75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/LocalTesting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
GEN: Ninja
VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
AZURE_STORAGE_CONNECTION_STRING: 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;'
AZURE_STORAGE_ACCOUNT: devstoreaccount1
HTTP_PROXY_RUNNING: '1'

steps:
Expand Down Expand Up @@ -87,6 +88,7 @@ jobs:
GEN: Ninja
VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
AZURE_STORAGE_CONNECTION_STRING: 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;'
AZURE_STORAGE_ACCOUNT: devstoreaccount1
HTTP_PROXY_RUNNING: '1'

steps:
Expand Down Expand Up @@ -161,6 +163,7 @@ jobs:
VCPKG_ROOT: ${{ github.workspace }}\vcpkg
VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake
AZURE_STORAGE_CONNECTION_STRING: 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;'
AZURE_STORAGE_ACCOUNT: devstoreaccount1

steps:
- uses: actions/checkout@v3
Expand Down
11 changes: 6 additions & 5 deletions test/sql/azure_scope_and_full_path.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require azure

require-env AZURE_STORAGE_CONNECTION_STRING

require-env AZURE_STORAGE_ACCOUNT

# Define secrets
statement ok
Expand All @@ -17,28 +18,28 @@ CREATE SECRET s1 (
statement ok
CREATE SECRET s2 (
TYPE AZURE,
SCOPE 'azure://devstoreaccount1.blob.core.windows.net',
SCOPE 'azure://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net',
CONNECTION_STRING 'INVALID CONNECTION STRING'
)

# Start with default provider
statement ok
CREATE SECRET s3 (
TYPE AZURE,
SCOPE 'azure://devstoreaccount1.blob.core.windows.net/testing-private',
SCOPE 'azure://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/testing-private',
CONNECTION_STRING '${AZURE_STORAGE_CONNECTION_STRING}'
)

# Ensure that the right secret is choose
query I
SELECT count(*) FROM 'azure://devstoreaccount1.blob.core.windows.net/testing-private/lineitem.csv';
SELECT count(*) FROM 'azure://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/testing-private/lineitem.csv';
----
60175


# Ensure that the right secret is choose using wildcard
query I
SELECT count(*) FROM 'azure://devstoreaccount1.blob.core.windows.net/testing-private/li*.csv';
SELECT count(*) FROM 'azure://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/testing-private/li*.csv';
----
60175

Expand All @@ -58,6 +59,6 @@ SET azure_storage_connection_string = '${AZURE_STORAGE_CONNECTION_STRING}'

# Now the wildcard scope should match
query I
SELECT count(*) FROM 'azure://devstoreaccount1.blob.core.windows.net/testing-public/lineitem.csv';
SELECT count(*) FROM 'azure://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/testing-public/lineitem.csv';
----
60175

0 comments on commit 7990d75

Please sign in to comment.