Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,36 @@ jobs:
- ubuntu-latest
arch:
- x64

services:
azurite:
image: mcr.microsoft.com/azure-storage/azurite:3.35.0
ports:
- 10000:10000 # Blob service
- 10001:10001 # Queue service
- 10002:10002 # Table service
options: >-
--health-cmd "nc -z 127.0.0.1 10000"
--health-interval 10s
--health-timeout 5s
--health-retries 10

env:
AZURE_TEST_MODE: local
AZURE_STORAGE_CONNECTION_STRING: UseDevelopmentStorage=true
AZURITE_BLOB_ENDPOINT: http://127.0.0.1:10000/devstoreaccount1
AZURITE_QUEUE_ENDPOINT: http://127.0.0.1:10001/devstoreaccount1
AZURITE_TABLE_ENDPOINT: http://127.0.0.1:10002/devstoreaccount1
AZURITE_ACCOUNT_NAME: devstoreaccount1
AZURITE_ACCOUNT_KEY: Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
- uses: actions/cache@v3
env:
cache-name: cache-artifacts
with:
Expand All @@ -35,9 +58,16 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-

# Wait for Azurite to be ready
- name: Wait for Azurite
run: |
timeout 30 bash -c 'until nc -z 127.0.0.1 10000; do sleep 1; done'
echo "Azurite is ready"

- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.jl.*.cov
*.jl.mem
openapi-generator-cli.jar
Manifest.toml
12 changes: 7 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,26 @@ Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d"
Mmap = "a63ad114-7e13-5084-954f-fe012c677804"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
OpenAPI = "d5e62ea6-ddf3-4d43-8e4c-ad5e6c8bfd7d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
XMLDict = "228000da-037f-5747-90a9-8195ccbf91a5"
URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
XMLDict = "228000da-037f-5747-90a9-8195ccbf91a5"

[compat]
Downloads = "1"
OpenAPI = "0.1"
XMLDict = "0.3,0.4"
JSON = "0.21"
MbedTLS = "0.6.8, 0.7, 1"
OpenAPI = "0.1,0.2"
TimeZones = "1"
URIs = "1.3, 1.4"
XMLDict = "0.3,0.4"
julia = "1.6"

[extras]
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Test", "HTTP", "JSON3"]
2 changes: 1 addition & 1 deletion src/StorageServices/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function extract_account_and_key(ctx, subscription_id::String, resource_group_na
account = String(split(split(uri, "/")[3], '.'; limit=2)[1])

# get keys for it
allkeys = storageAccountsListKeys(Azure.api(ctx, StorageAccountsApi), resource_group_name, account, apiver(StorageAccountsApi), subscription_id)
allkeys = storageAccountsListKeys(Azure.api(ctx, StorageManagementClient.StorageAccountsApi), resource_group_name, account, apiver(StorageManagementClient.StorageAccountsApi), subscription_id)
key = (allkeys.keys[1]).value

AccountKey(account, key)
Expand Down
26 changes: 26 additions & 0 deletions test/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Azure.jl Environment Configuration

# Testing Mode: "local" for Azurite emulator, "azure" for real Azure services
AZURE_TEST_MODE=local

# Local Development with Azurite
AZURE_STORAGE_CONNECTION_STRING=UseDevelopmentStorage=true
AZURITE_BLOB_ENDPOINT=http://127.0.0.1:10000/devstoreaccount1
AZURITE_QUEUE_ENDPOINT=http://127.0.0.1:10001/devstoreaccount1
AZURITE_TABLE_ENDPOINT=http://127.0.0.1:10002/devstoreaccount1
# Note: Azurite does not support File Storage service
AZURITE_ACCOUNT_NAME=devstoreaccount1
AZURITE_ACCOUNT_KEY=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==

# Real Azure Services (when AZURE_TEST_MODE=azure)
# AZURE_TENANT_ID=your-tenant-id
# AZURE_CLIENT_ID=your-client-id
# AZURE_CLIENT_SECRET=your-client-secret
# AZURE_SUBSCRIPTION_ID=your-subscription-id
# AZURE_RESOURCE_GROUP=your-resource-group
# AZURE_STORAGE_ACCOUNT=your-storage-account
# AZURE_STORAGE_KEY=your-storage-key

# HTTP Mocking (for management API testing)
AZURE_MOCK_SERVER=false
AZURE_MOCK_PORT=8080
1 change: 1 addition & 0 deletions test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
Loading