azure-storage-fuse/azure-pipeline-templates/e2e-tests.yml

93 строки
2.4 KiB
YAML
Executable File

parameters:
- name: working_dir
type: string
- name: mount_dir
type: string
- name: temp_dir
type: string
- name: idstring
type: string
- name: distro_name
type: string
- name: mountStep
type: step
- name: adls
type: boolean
- name: clone
type: boolean
default: false
- name: quick_test
type: boolean
default: true
- name: enable_symlink_adls
type: boolean
default: false
- name: artifact_name
type: string
- name: verbose_log
type: boolean
default: false
steps:
# Mount the container
- template: 'mount.yml'
parameters:
working_dir: ${{ parameters.working_dir }}
mount_dir: ${{ parameters.mount_dir }}
temp_dir: ${{ parameters.temp_dir }}
prefix: ${{ parameters.idstring }}
mountStep: ${{ parameters.mountStep }}
# Run End to End test
# Check blobfuse2 is mounted or not
- script: |
df
echo "-------------------------------------------------------------------"
df | grep blobfuse2
exit $?
displayName: 'Verify Mount'
- script: |
out=`pidstat -p \`pidof blobfuse2\` -u 2 5 | tail -n 1`
outData=($out)
cpu=${outData[7]}
echo "CPU is :" $cpu
if [[ $cpu > 5 ]]
then
echo "CPU usage is high"
exit 1
else
echo "CPU usage is low"
fi
displayName: 'CPU Usage test'
- task: Go@0
inputs:
command: 'test'
arguments: '-v -timeout=2h ./... -args -mnt-path=${{ parameters.mount_dir }} -adls=${{parameters.adls}} -clone=${{parameters.clone}} -tmp-path=${{parameters.temp_dir}} -quick-test=${{parameters.quick_test}} -enable-symlink-adls=${{parameters.enable_symlink_adls}} -distro-name="${{parameters.distro_name}}"'
workingDirectory: ${{ parameters.working_dir }}/test/e2e_tests
displayName: 'E2E Test: ${{ parameters.idstring }}'
timeoutInMinutes: 120
continueOnError: false
env:
mount_dir: ${{ parameters.mount_dir }}
# Publish build artifacts
# Publish build artifacts to Azure Pipelines or a Windows file share
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: blobfuse2-logs.txt
artifactName: ${{ parameters.artifact_name }}
condition: ${{ parameters.verbose_log }}
- script: |
tail -n 200 blobfuse2-logs.txt
displayName: 'View Logs'
condition: failed()
- script: |
> blobfuse2-logs.txt
displayName: 'Clear Logs'
condition: always()