Amplify-console: What does the test>artifacts section of build settings represent for an Angular project?

Created on 2 Dec 2019  ·  9Comments  ·  Source: aws-amplify/amplify-console

test:
  phases:
    preTest:
      commands:
        - wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
        - yum install -y ./google-chrome-stable_current_*.rpm
        - npm ci
    test:
      commands:
        - npm run test:ci
  artifacts:
    baseDirectory: ???
    files:
      - '**/*'

"test:ci": "ng test --no-watch --no-progress --browsers ChromeHeadlessCI",

Is it meant to define where all your tests are located? Or is it meant to define where the output artifacts will go after your tests are run? What if my tests don't have an output artifacts (as is the case above), what should I put here?

bug docs question

Most helpful comment

Hi @Joycehao19, this was only ever resolved via the workaround

All 9 comments

There is not much documentation on this (and testing breaks the build for me) but from general practise testing artifacts are reports that the tests produce such as coverage, images and movies. These reports (artifacts) will be uploaded to be downloaded and looked at after the testing phase.

I know! Testing breaks the build for me as well, which means I can't have testing-passing as one of my checks before deploying. Very frustrating, and massively prohibitive.

As a work around i put my testing in the build but that is a horrific workflow

@jkar32 good advice, I'll try this.

Hi @Joycehao19, this was only ever resolved via the workaround

This is still an issue in 2020 🤦‍♂ @swaminator would it be possible to get an update?

I'm trying to test my app via a shell script that doesn't produce output other than stdout and a result code – this requirement on artifacts is breaking my build.

Apologies for the lack of movement on this. I'm going to look more into this, and provide an update.

Has there been any progress on documenting this yet? Even to just get an idea of what reporter formats are supported so we can possibly use the test phase for jest unit tests, etc. would be great.

Was this page helpful?
0 / 5 - 0 ratings