Pulling Test Data from a GitLab Repo
At the start of the test i have a data that is pulled from various sources to build the correct environment with the latest exes and data.
I have the lastest exes copied from a network location successfully but I have a GitLab repo that the client updates and i am struggling to get TestComplete to connect to the Repo and pull down. Are there any examples for pulling down from a GitLab repo to a local machine drive.
All examples i can find refer to TestComplete and it's inbuilt option for pulling down the latest test pack but not a method for pulling down test environment data.
Any pointers in the right direction would be appreciated.
I would design my pipeline to either pull down from source code repository or from network share all related pieces (automation project, data, binaries, etc...) to set up the environment, than when ready I would execute my automation run.
If I understand it correctly, you are trying to have TestComplete project during the test run pull down data from GitLab and copy binaries from network drive. In that case you can achieve this using a git clone or git pull command. I have not tried the bellow example.
function PullFromGitLab() { // Create a shell object to run command line operations var shell = Sys.OleObject("WScript.Shell"); // Define the local path where the repo should live var repoPath = "C:\\TestEnv\\DataRepo"; // Check if the folder exists if (aqFileSystem.Exists(repoPath)) { // If it does, navigate there and run git pull var pullCmd = 'cmd.exe /C cd /d "' + repoPath + '" && git pull'; Log.Message("Running: " + pullCmd); shell.Run(pullCmd, 0, true); } else { // If not, clone the repo into that directory var gitUrl = "https://gitlab.com/yourgroup/yourrepo.git"; // Replace with your actual repo URL var cloneCmd = 'cmd.exe /C git clone "' + gitUrl + '" "' + repoPath + '"'; Log.Message("Running: " + cloneCmd); shell.Run(cloneCmd, 0, true); } }
Note: on the agent or VM, per-configure Git and authentication. Also make sure you're using an HTTPS URL with a personal access token (PAT),
example: https://oauth2:YOUR_TOKEN@gitlab.com/yourgroup/yourrepo.gitP.S. if you like my post give a like, and if it solves your problem mark it as a solution.