Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🛠️ Run an automated test in Azure #7999

Closed
1 task
Tracked by #10217
petertgiles opened this issue Sep 22, 2023 · 6 comments · Fixed by #9652
Closed
1 task
Tracked by #10217

🛠️ Run an automated test in Azure #7999

petertgiles opened this issue Sep 22, 2023 · 6 comments · Fixed by #9652
Assignees
Labels
tooling Tooling, automation and CI to support development.

Comments

@petertgiles
Copy link
Contributor

petertgiles commented Sep 22, 2023

🛠️ Tooling

We recently had a few near misses with issues found in UAT in Azure before deployment. There was the auth issue where the first request after logging in failed. And then the database upgrade with the misconfigured extension. I was thinking that it would be handy if we could run a batch of tests like Cypress Playwright against the dev or uat instance in Azure.

If the dev vertical was open to the Internet I wonder if it would be possible to open Cypress on a dev's machine and point it at the Azure instance?

✅ Acceptance Criteria

  • How do we manually run a batch of automated tests against an instance running in Azure Dev

Timebox

3 days

@petertgiles petertgiles added the tooling Tooling, automation and CI to support development. label Sep 22, 2023
@brindasasi brindasasi added the spike Learn more about something we can't estimate yet. label Oct 19, 2023
@brindasasi
Copy link
Contributor

Tests are failing in Azure pipeline with the below error as they couldn't access the dev or UAT site. They can access prod site without any issues.
Error: page.goto: net::ERR_CONNECTION_TIMED_OUT at https://dev-talentcloud.tbs-sct.gc.ca/login-info
I believe there is some restriction on the sites under vpn to block automated tests.
I reached out to Carl and he suggested to create an Azure incident ticket and he will have someone look into it as we might be missing some access.
Created #AZ19428

@brindasasi brindasasi added the blocked Blocked by work that's out-of-scope of the issue itself. label Mar 13, 2024
@brindasasi
Copy link
Contributor

IMTD mentioned that since the tests are invoked by Azure managed pipelines , it uses various ips and F5 is blocking them.
The suggested solution is to use self hosted VMs.
I've asked them to install the necessary apps into T1_Dev_Management VM.
Waiting on that .............

@brindasasi
Copy link
Contributor

brindasasi commented Mar 20, 2024

Yayy 🥳.. some one is actually working on this although he is waiting on the security approval from someone else 😅

DASTPIERSt-Pierre, Daniel added a comment - Yesterday
Salut Baker, Michel ,

Please see what I think would be required to get a self-hosted agent working for this use-case:

AZ-19428 Automated tests doesn't run on Azure Pipeline against dev site - TBS-SCT JIRA

Would that meet security approval?

Thanks,

Dan

CC: Blott, Robert

DASTPIERSt-Pierre, Daniel logged work - 2024-03-19 1:20 PM
Time Spent: 1 hour

Assessment of what would be installed on self-hosted agent

reference pipeline: https://github.com/GCTC-NTGC/gc-digital-talent/blob/7999-integrate-playwright-azure/infrastructure/azure-pipelines-dev.yml

PHP and Composer would be install on self-hosted agent vm.
Node/npm would be installed on self-hosted agent vm

pipeline execution of script "deploy.sh" specified node v20.11.0

Workload:

php 8.2
info: https://wiki.crowncloud.net/?How_to_install_php_8_2_on_Ubuntu_20_04
agent VM mostly likely needs access to:
keyserver.ubuntu.com (tcp: 11371)
ppa.launchpadcontent.net/ondrej/php/ubuntu/ (tcp: 443)
php composer
info: https://getcomposer.org/
agent VM most likely needs access to:
repo.packagist.org (tcp: 443)
api.github.com (tcp: 443)
github.com (tcp: 443)
codeload.github.com (tcp: 443)
node/npm (v20.11.0 as defined in project script:

)
download: https://nodejs.org/dist/v20.11.0/node-v20.11.0-linux-x64.tar.xz
manual install bare info:
https://www.tencentcloud.com/document/product/213/34812
https://stackoverflow.com/questions/65775227/how-can-i-install-nodejs-manually-in-linux-from-terminal

Assessment of Devops Artifacts Feed

Current npm feed already exists at organization scope: TBS_Custom_Npm_Feed
May need to adjust feed permissions to allow TC developers access to read/write

Adjust affected devops users' VMs and project code according to feed connection steps: https://dev.azure.com/tbs-sct/Talent%20Cloud/_packaging?_a=connect&feed=TBS_Custom_Npm_Feed

@gobyrne gobyrne removed the blocked Blocked by work that's out-of-scope of the issue itself. label Apr 10, 2024
@brindasasi
Copy link
Contributor

Azure Dev Pipeline :
GCTC-NTGC.gc-digital-talent.dev -

This pipeline already is set to run with dev dependencies like faker.
Now we have split it into 2 stages

Build Stage -
Code changes are built and an artifact has been created. This build agent has been hosted by Azure.

Test Stage
In this stage , this artifact has been feed into an self hosted build agent and tests can run against either Dev or UAT sites those are under VPN.

This infrastructure has been set up and ready to use.

Now the playwright tests are running but needs some refactoring to use the actual GCKey Sign in instead of the mock auth.

We create some test accounts as we did on UAT for UX testing and feed into these tests.

Only thing we are waiting on this from IMTD is to provide the easy way of getting the test logs. Currently it is under self hosted vm.

Daniel is working on to get this on to a storage account so we can download it easily.

@brindasasi
Copy link
Contributor

So all the infrastructure is now set up and I try my best to list the details in the PR.
I've created below ticket for adding GCKey logins to the tests
#10217

@brindasasi brindasasi removed the spike Learn more about something we can't estimate yet. label May 27, 2024
@brindasasi
Copy link
Contributor

This is not a spike anymore.
This is actually delivers a pipeline in Azure that can tun the playwright tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Tooling, automation and CI to support development.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants