Skip to content

Commit

Permalink
feat: zine generator basic (#2)
Browse files Browse the repository at this point in the history
* Don't check coverage

* xo-fix

* Ignore prettier

* Fixed error handler index

* Sonar scan sources

* Untar the coverage

* Include template

* Dynamic sonar-project.properties

* Don't do max depth

* Fixed env var

* Expect 404
  • Loading branch information
superflyxxi authored Oct 29, 2021
1 parent 7c1ceca commit de8729e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
18 changes: 14 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,15 @@ jobs:
npm test
- run:
name: Tar coverage
working_directory: ./<< parameters.project >>
command: tar -vcf << parameters.project >>-coverage.tar coverage/
command: tar -vcf << parameters.project >>-coverage.tar << parameters.project >>/coverage/
- store_test_results:
path: ./<< parameters.project >>/mocha
- store_artifacts:
path: ./<< parameters.project >>/mocha/test-results.xml
- store_artifacts:
path: ./<< parameters.project >>/coverage/
- persist_to_workspace:
root: ./<< parameters.project >>
root: ./
paths:
- ./*coverage.tar*
- run:
Expand All @@ -96,6 +95,17 @@ jobs:
- checkout
- attach_workspace:
at: .
- run:
name: Untar coverage
command: |
tar -vxf ./*coverage.tar*
- run:
name: Configure sonar-project.properties
command: |
printf "sonar.sources=%s\n" $(find . -maxdepth 2 -name src -type d | xargs echo | sed 's/ /,/g') >> sonar-project.properties
printf "sonar.tests=%s\n" $(find . -maxdepth 2 -name test -type d | xargs echo | sed 's/ /,/g') >> sonar-project.properties
printf "sonar.javascript.lcov.reportPaths=%s\n" $(find . -name lcov.info -type f | xargs echo | sed 's/ /,/g') >> sonar-project.properties
cat sonar-project.properties
- sonarcloud/scan

build-docker:
Expand Down Expand Up @@ -229,7 +239,7 @@ jobs:
file: << parameters.project >>/docker-compose.<< parameters.env >>.yml
service: ${CIRCLE_PROJECT_REPONAME}/<< parameters.project >>
- execute-remote:
command: ci-deploy.sh ${CIRLCE_PROJECT_REPONAME}-<< parameters.project >>-<< parameters.env >>
command: ci-deploy.sh ${CIRCLE_PROJECT_REPONAME}-<< parameters.project >>-<< parameters.env >>

integration-test:
executor: docker/machine
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
!template/.mocharc.json
**/.xo-config.json
!template/.xo-config.json
**/.prettierrc.json
!template/.prettierrc.json


# Standard Stuff Below

Expand Down
6 changes: 3 additions & 3 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ sonar.projectKey=superflyxxi_social-zine
sonar.organization=superflyxxi

# Path to sources
sonar.sources=template/src/
#sonar.sources=src/
#sonar.exclusions=
#sonar.inclusions=

# Path to tests
sonar.tests=template/test/
#sonar.tests=test/
#sonar.test.exclusions=
#sonar.test.inclusions=

Expand All @@ -19,4 +19,4 @@ sonar.tests=template/test/

sonar.issues.defaultAssigneeLogin=superflyxxi

sonar.javascript.lcov.reportPaths=coverage/lcov.info
#sonar.javascript.lcov.reportPaths=zine-generator/coverage/lcov.info
2 changes: 1 addition & 1 deletion template/.c8rc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"reporter": ["text", "lcov"],
"check-coverage": true,
"check-coverage": false,
"all": true,
"src": ["src/"],
"lines": 80,
Expand Down
4 changes: 2 additions & 2 deletions zine-generator/int-test/end-to-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ describe('End-to-end integration tests', () => {
.send({
generator: true,
from: false,
to: false
to: false,
})
.end((error, res) => {
expect(error).to.equal(null);
expect(res.status).to.equal(200);
expect(res.status).to.equal(404);
});
done();
}).timeout(30_000);
Expand Down

0 comments on commit de8729e

Please sign in to comment.