I'm looking to move a Visual Studio 2022 .Net test project from the Bitbucket pipeline where it currently runs into an Azure DevOps pipeline.
Currently I have a custom docker image which I use and then run the tests using that, I'm not entirely sure how to convert the bitbucket.yml into azure.yml so any advice would be greatly appreciated.
Example of the bitbucket.yml, I've replaced named spaces in the :
image:
name: <dockerContainerName>
pipelines:
default:
- step:
name: "Run Tests in Testing"
script:
- export CHROME_BIN=`which google-chrome`
- export ENV='testing'
- echo $CHROME_BIN
- echo $PROFILE_TYPE
- echo $FEATURE_TYPE
- dotnet restore
- dotnet test
artifacts:
- $BITBUCKET_CLONE_DIR/<projectName>/bin/Debug/Screenshots/*
branches:
staging:
- step:
name: "Run Tests in Staging"
script:
- export CHROME_BIN=`which google-chrome`
- export ENV='staging'
- echo $CHROME_BIN
- echo $PROFILE_TYPE
- echo $FEATURE_TYPE
- dotnet restore
- dotnet test
artifacts:
- $BITBUCKET_CLONE_DIR/<projectName>/bin/Debug/Screenshots/*
Thought might help to also see the dockerfile in the project too:
FROM mcr.microsoft.com/dotnet/sdk:5.0-focal
RUN apt update -y
WORKDIR /app
COPY . /app/
RUN apt install -y wget unzip
RUN apt update && apt install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
hicolor-icon-theme \
libcanberra-gtk* \
libgl1-mesa-dri \
libgl1-mesa-glx \
libpango1.0-0 \
libpulse0 \
libv4l-0 \
fonts-symbola \
--no-install-recommends
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y tzdata
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN dpkg -i google-chrome-stable_current_amd64.deb
RUN apt -f install -y