bahmutov / bahmutov/test-rail-suite-example

AWS CodeBuild Buildspec Example

Open
#4 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Hi @bahmutov,

I know you're incredibly busy but any chance you'd be able to put together a buildspec.yml version for AWS CodeBuild that reflects your [Github Actions example](https://github.com/bahmutov/test-rail-suite-example/blob/main/.github/workflows/ci.yml)? After much tinkering, I can't seem to get it to work. Very appreciative of your help!

My currently-failing example:
```
version: 0.2

batch:
fast-fail: false
build-matrix:
dynamic:
env:
variables:
CY_GROUP_SPEC:
- "UI - Chrome|chrome|cypress/integration/smoke/**/*|viewport=macbook-16"
WORKERS:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9

env:
// May use parameter-store or secrets-manager, variables were hard-coded below for testing purposes.
variables:
TESTRAIL_HOST: [redacted]
TESTRAIL_USERNAME: [redacted]
TESTRAIL_PASSWORD: [redacted]
TESTRAIL_PROJECTID: 2
TESTRAIL_SUITEID: 1805
TESTRAIL_RUN_ID: ${{ steps.testRail.outputs.runId }}

phases:
install:
runtime-versions:
nodejs: latest
commands:
- export COMMIT_INFO_BRANCH="$(git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed 's/remotes\/origin\///g')"
- export COMMIT_INFO_MESSAGE="$(git log -1 --pretty=%B)"
- export COMMIT_INFO_EMAIL="$(git log -1 --pretty=%ae)"
- export COMMIT_INFO_AUTHOR="$(git log -1 --pretty=%an)"
- export COMMIT_INFO_SHA="$(git log -1 --pretty=%H)"
- export COMMIT_INFO_REMOTE="$(git config --get remote.origin.url)"
- echo $COMMIT_INFO_BRANCH
- echo $COMMIT_INFO_MESSAGE
- echo $COMMIT_INFO_EMAIL
- echo $COMMIT_INFO_AUTHOR
- echo $COMMIT_INFO_SHA
- echo $COMMIT_INFO_REMOTE
- echo $CODEBUILD_INITIATOR
- echo $CY_GROUP_SPEC
- CY_GROUP=$(echo $CY_GROUP_SPEC | cut -d'|' -f1)
- CY_BROWSER=$(echo $CY_GROUP_SPEC | cut -d'|' -f2)
- CY_SPEC=$(echo $CY_GROUP_SPEC | cut -d'|' -f3)
- CY_CONFIG=$(echo $CY_GROUP_SPEC | cut -d'|' -f4)
- echo $CY_GROUP
- echo $CY_BROWSER
- echo $CY_SPEC
- echo $CY_CONFIG
- npm ci
pre_build:
commands:
- npm run cy:verify
- npm run cy:info
build:
on-failure: CONTINUE
commands:
- runName="Testing on AWS CodeBuild"
- runDescription="Cypress Automated Smoke Suite"
- echo ${runName}
- echo ${runDescription}
- runId=$(npx testrail-start-run "${runName}" "${runDescription}")
- echo "TestRail run id ${runId}"
- echo "::set-output name=runId::${runId}"
- npx cypress run --record --parallel --env configFile=$CYPRESS_CONFIG_FILE --browser chrome --ci-build-id $CODEBUILD_INITIATOR --group "$CY_GROUP" --spec "$CY_SPEC" --tag "$CYPRESS_TAG,smoke" --record --reporter mochawesome
post_build:
commands:
- npx testrail-close-run ${{ steps.testRail.outputs.runId }}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Read the referenced .github/workflows/ci.yml and compare it with the failing buildspec example in the issue. Test the AWS CodeBuild configuration with the repository's Cypress and TestRail workflow; done means the buildspec reproduces the GitHub Actions behavior and completes the smoke suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, cypress, github-actions, javascript
Domain
ci-cd, testing
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.