Skip to content

Commit a432c63

Browse files
committed
Added test data for integration tests
1 parent f8bd5cb commit a432c63

File tree

5 files changed

+28
-2
lines changed

5 files changed

+28
-2
lines changed

.github/workflows/test_azure_devtest_labs_integration.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ jobs:
3636
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3737
- uses: actions/checkout@v2
3838

39+
- name: Find test files
40+
run: |
41+
find ./DataPipelineTools.Functions.Tests/TestData -type f -name ".keepFolder"|while IFS=/ read filename; do
42+
echo "$filename"
43+
relativePath=$(echo "$filename" | sed -r 's/\.\/DataPipelineTools\.Functions\.Tests//g')
44+
echo "$relativePath"
45+
done
46+
3947
4048
# Build and run the unit tests
4149
- name: Setup .NET
@@ -160,6 +168,7 @@ jobs:
160168
echo "Deployment Outputs"
161169
#echo "::set-output name=STORAGE_ACCOUNTCONNECTION_STRING::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.storageAccountConnectionString.value')"
162170
echo "::set-output name=STORAGE_ACCOUNT_NAME::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.storageAccountName.value')"
171+
echo "::set-output name=STORAGE_CONTAINER_NAME::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.storageContainerName.value')"
163172
echo "::set-output name=FUNCTIONS_APP_NAME::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.functionsAppName.value')"
164173
echo "::set-output name=FUNCTIONS_APP_URI::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.functionsAppUri.value')"
165174
echo "::set-output name=KEY_VAULT_NAME::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.keyVaultName.value')"
@@ -180,6 +189,7 @@ jobs:
180189
#echo "FUNCTIONS_APP_KEY: ${{ steps.create-devtest-labs-environment.outputs.FUNCTIONS_APP_KEY }}"
181190
#echo "STORAGE_ACCOUNTCONNECTION_STRING: ${{ steps.create-devtest-labs-environment.outputs.STORAGE_ACCOUNTCONNECTION_STRING }}"
182191
echo "STORAGE_ACCOUNT_NAME: ${{ steps.create-devtest-labs-environment.outputs.STORAGE_ACCOUNT_NAME }}"
192+
echo "STORAGE_CONTAINER_NAME: ${{ steps.create-devtest-labs-environment.outputs.STORAGE_CONTAINER_NAME }}"
183193
echo "KEY_VAULT_NAME: ${{ steps.create-devtest-labs-environment.outputs.KEY_VAULT_NAME }}"
184194
echo 'RUN_SETTINGS: ${{ steps.create-devtest-labs-environment.outputs.RUN_SETTINGS }}'
185195
@@ -229,11 +239,22 @@ jobs:
229239
uses: kheiakiyama/[email protected]
230240
with:
231241
version: 'v10'
242+
creds: '${{ secrets.AZURE_DEV_TEST_LABS_CREDENTIALS }}'
232243

233244
- name: Copy files to Azure Data Lake using AZCopy
234245
run: |
235-
ls -ltA
236-
#azcopy_v10 --source {SOURCE} --destination {DEST} --dest-key ${{ secrets.STORAGE_KEY }} --recursive --set-content-type
246+
247+
STORAGE_ACCOUNT_NAME="${{ steps.create-devtest-labs-environment.outputs.STORAGE_ACCOUNT_NAME }}"
248+
STORAGE_CONTAINER_NAME="${{ steps.create-devtest-labs-environment.outputs.STORAGE_CONTAINER_NAME }}"
249+
# The exclude patter for the .keepDirectory files is not working, so workaround below if to find these files and remove them from ADLS
250+
azcopy copy "./DataPipelineTools.Functions.Tests/TestData" "https://$STORAGE_ACCOUNT_NAME.dfs.core.windows.net/$STORAGE_CONTAINER_NAME" --recursive=true --exclude-pattern=".keepDirectory"
251+
252+
# Remove the .keepDirectory files, these are just used to allow us to add empty folders into the sample data in Git
253+
find ./DataPipelineTools.Functions.Tests/TestData -type f -name ".keepFolder"|while IFS=/ read FILENAME; do
254+
RELATIVE_PATH=$(echo "$FILENAME" | sed -r 's/\.\/DataPipelineTools\.Functions\.Tests\///g')
255+
azcopy rm "https://$STORAGE_ACCOUNT_NAME.dfs.core.windows.net/$STORAGE_CONTAINER_NAME/$RELATIVE_PATH"
256+
done
257+
237258
238259
- name: 'Deploy Azure Functions to Lab Environment using RBAC'
239260
uses: Azure/functions-action@v1

Azure-DevTestLab/Environments/sqlcollaborative_AzureDataPipelineTools/azuredeploy.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,11 @@
537537
"type": "string",
538538
"value": "[variables('adlsStorageAccountName')]"
539539
},
540+
"StorageContainerName": {
541+
"type": "string",
542+
"value": "[parameters('adlsStorageAccountContainerName')]"
543+
},
544+
540545
"keyVaultName": {
541546
"type": "string",
542547
"value": "[variables('keyVaultName')]"

DataPipelineTools.Functions.Tests/TestData/TestFolder1/TestDoc1.txt

Whitespace-only changes.

DataPipelineTools.Functions.Tests/TestData/TestFolder1/TestDoc2.txt

Whitespace-only changes.

DataPipelineTools.Functions.Tests/TestData/TestFolder2/.keepFolder

Whitespace-only changes.

0 commit comments

Comments
 (0)