Open clemblanco opened 4 months ago
This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!
It's been a month and a half. Any update on this one?
@clemblanco right now we only upload build artifacts if the build succeeds or if it fails due to a bundle size error .
What use case are you looking for?
@mauerbac well if a build fails because of some e2e tests failing we want to be able to download our artifacts generated by Cypress such as screenshots and videos. This used to be possible with the first Amplify console. Not anymore unless if we use the AWS CLI directly, meaning such files are still generated and uploaded to your own private S3. They just aren't offered to download directly from the console anymore which is very annoying.
ah, understood -- sorry. You want to download test artifacts easily in the Gen2 UI . Let me share this with our console team
hi @clemblanco - i spoke to the team. There should be no difference in functionality between the new and old console UI as it pertains to this feature. If you don't see the download button that means there is some issue preventing us for giving you the logs.
Either 1/ you have your own amplify.yml
file or you didn't deploy through the console so app.buildSpec
was not setup
The solution would be to take whatever you have in your own custom build spec and paste it into the Build Settings section for the app in the console
@mauerbac it's the exact same amplify.yml and when we analyse the logs we can see Amplify uploading the same files to your S3 bucket which is how we figured out we could maybe use the AWS CLI to generate some signed URLs to directly download these files.
I've just tried pasting it into the console with no luck. The artifacts from the failing test phase are no longer accessible whatsoever, only standard logs are.
I have root access on my account so I don't think it's a permission issue.
This is what I'm referring to:
artifacts>files The generated artifacts (screenshots and videos) available for download.
Source: https://docs.aws.amazon.com/amplify/latest/userguide/running-tests.html
If you don't see the download button that means there is some issue preventing us for giving you the logs.
I do see the button it's just only giving me text logs which I already have in the console UI.
We don't have a custom buildspec.yml
file. Only an amplify.yml
one. Which we tried to copy paste into the console already.
ah, ok - i see. The issue is probably in the amplify.yml
file. Amplify Console detects whether an app has been configured to run Cypress tests by searching for one the following phases in the app’s build spec: preTest: , test:, postTest:
preTest
Install the dependencies required to run Cypress tests. Amplify Hosting uses mochawesome to generate a report to view your test results and wait-on to set up the localhost server during the build.
test
Run cypress commands to perform tests using mochawesome.
postTest
The mochawesome report is generated from the output JSON. Note that if you are using Yarn, you must run this command in silent mode to generate the mochawesome report. For Yarn, you can use the following command.
You may need to edit your file with one of these commands. If you need further help, could you contact me with your account number + appId + build id and ill take a look. You can DM me on Twitter, Discord or amazon email with my username on github
We already have these in our amplify.yml
I will DM you.
Before opening, please confirm:
Amplify Hosting feature
E2E Cypress tests
Is your feature request related to a problem? Please describe:
It looks like with Amplify 2, build artifacts can only be downloaded for successful builds, not failing builds. However, they are the most useful to us to troubleshoot things when our E2E tests are failing before deploying, therefore we need to be able to access them for failed builds too.
Describe how you'd like this feature to work
Same as for successful builds but for failed builds too.
We can even see in the logs for failed builds that the artifacts are indeed uploaded to your S3 bucket
https://aws-amplify-prod-[region]-artifacts.s3.[region].amazonaws.com/[app_id]/[branch]/000000[build_number]/BUILD/artifacts.zip
, so it's not like they were not existing at all.