Azure DevOps Testing - npm

The basic purpose is to test a profile image upload API. I have an API which takes image file as an input and updates the profile picture according to given auth. I ran this API in postman and it was working fine. Now what I want to achieve is that I want to run this collection which has just one API for now on Azure devOps using npm, newman and publish test results. The issue that i am facing is that I can not find a way to upload that file. In postman collection, file path is the path in which your file is placed on your pc. In order to Run that api on devOps, what path should i give? Also, is there a way to upload an image or any sort of file?

In postman collection, file path is the path in which your file is
placed on your pc.
According to this description, you should want to upload the picture to a local file path.
The first thing that is clear is that you need to use the self-hosted agent to run the pipeline,because only if you use the agent installed on your local machine to run, you can track your local file path in Azure Devops. You can refer to this document on how to install a self-hosted agent.
Usually, the postman collection is exported as a .json file and then pushed it into the repo. If you set the file path in the collection, is it included in the collection.json?
In addition, it is difficult to reproduce your issue based on the information available, more detailed information is needed for further investigation:1. Which api are you using?
2.Postman collection settings 3.Specific operation process 4. Pipeline definition. It will be easier to understand in the form of screenshots.

Related

How can I set a file upload function?

I am creating an SAPUI5 WebApp with an file upload function. I try this example from SAPUi5 Explored: sap.m.sample.UploadCollection
I try with my trial account in SAP WebIDE to set the upload function ( Upload Collection)
The issue is, not allowing to upload a file in the project folder or local desktop folder.
If I upload a file it appears but i can't open it and I get a 405 HTTP
error.
Any Ideas, what the problem is?
like you see already in your posts comments, you need a backend for this task. The UploadCollection control is only usable with a backend in the background which receives the transmitted file from the control.
On the page https://sapui5.hana.ondemand.com/#/api/sap.m.UploadCollection you see
This control allows you to upload single or multiple files from your devices (desktop, tablet or phone) and attach them to the application
while you can replace "application" with "receiving backend"
Indipendent of this may I allowed to ask where do you think the file should be uploaded when not to a backend system? I mean when you choose a file from your local storage it doesn't make any sense to upload it again to your local storage?!

How to get file path in Asp.net core to work in Azure Dev Ops

Am trying to read Text File content. So i am using below line of code it is working in local .
string src = #"Templates\UserMailTemplate.txt";
string[] content = System.IO.File.ReadAllLines(src);
After hosting in Azure Dev Ops .Am getting issue as
Could not find file 'D:\home\site\wwwroot\Templates\UserMailTemplate.txt'.
Server.Mappath is not working in ASP.Net Core .
Please let me know how can i resolve this in DEV ops.
The cause of your issue is in the error message: Could not find file. This probably means the file is either not published, or not published at the location you're expecting it to be.
Please validate that you're looking in the right location.
To enable having the files available after publish, either
1. Have a look at IHostingEnvironment and its properties
2. Set the Build Action to Content and access it using Application.GetContentStream
3. Set the Build Action to Embedded Resource and call Assembly.GetManifestResourceStream to read the file from the assembly
4. Set Copy to Output Directory to Copy always or Copy if newer and access the files in the output directory
'Slightly' off-topic
Please have a look at a completely different way to manage mail templates in Azure. The easiest change from what you're doing now is probably to store them in Azure Storage.
If you persist in using files, please refer to this Azure Tip: Working with Files in Azure App Service

How can I list all uploads for a project?

I would like to access the list of all uploads that have been added to a given project on my company GitLab server.
I don't mean versionned files, I mean attached files: binaries and other types of files that have been attached to issues, merge requests, etc.
It's OK if I have to use the API for that.
What I've tried
My first approach was through GET /projects/:id/repository/files/:file_path, but that's for the versionned files.
Then, I found out about POST /projects/:id/uploads, but that's only for uploading and not for listing already uploaded files.
Is there a way to list all those uploaded files?
I believe this is not possible.
There is an open issue for retrieving specific files which has not received much attention:
https://gitlab.com/gitlab-org/gitlab-ce/issues/55520
Hopefully, in the future, there will eventually be an endpoint
GET /projects/:id/uploads
I had the same question and after getting in touch with gitlab support they confirmed that this is not currently implemented (as of now, November 2021), and forwarded me the 3 following feature requests :
API list all files on a project : https://gitlab.com/gitlab-org/gitlab/-/issues/197361
Attachment Manager : https://gitlab.com/gitlab-org/gitlab/-/issues/16229
Retrieve uploaded files using API : https://gitlab.com/gitlab-org/gitlab/-/issues/25838
A workaround seems to be to export the whole project, and you'll find the uploads in that archive, and you'll be able to list them.

qooxdoo's api-viewer run offline

I dont know how to make qooxdoo's api-viewer run offline.
http://www.qooxdoo.org/current/apiviewer/#
Any help?
just run generate with the api target and you get a local copy of the api viewer wich also documeents your own project.
./generate.py api
then start a local web server in the newly generated api directory
cd api
python -mSimpleHTTPServe
and open http://localhost:8000

VM Depot SourceImageName using Azure REST API

I'm using the Create Virtual Machine Deployment method of the Azure REST API: http://msdn.microsoft.com/en-us/library/windowsazure/jj157194.aspx
I'm trying to use an image sourced from the VM Depot, with a path such as this:
http://vmdepotwestus.blob.core.windows.net/linux-community-store/community-4-d803ca0a-5d98-4be8-8895-2a9d15ec3974-1.vhd
I am currently getting the following error:
The virtual machine image source is not valid.
I am assuming there is some process which first needs to be completed in order to make that image available to the specific API user, but I can't seem to work out what?
You can't deploy directly from VM Depot. You must first copy the image to your own storage account. There are instructions on the VM Depot help page for doing this via the Azure Management portal (see http://vmdepot.msopentech.com/Help/Help.cshtml#deployingUsingAUX). It can also be done via the CLI tools, see http://www.windowsazure.com/en-us/manage/install-and-configure-cli/#use
It is more complicated. You have to download the VHD from some link in VM Depot in your storage, create the image, then provision the machine.
The command line of VMdepot to do that is in node, so you can very easily reverse it to see how it works.
On the other hand, I do it also with IaaS Management Studio, you might be able to take a look with reflector how I did.