From cce8aaa5d7121f003969043cd0049bf1ad53c3b0 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 6 Jun 2024 17:02:54 -0400 Subject: [PATCH 1/8] adding component definitioin --- codecov.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/codecov.yml b/codecov.yml index 34bfe06..c946502 100644 --- a/codecov.yml +++ b/codecov.yml @@ -57,6 +57,13 @@ flags: javascript: paths: - resources/js - backend: - paths: - - .* + +component_management: + individual_components: + - component_id: "backend" + paths: + - ".*" + flag_regexes: # List. Flags to be included in the component. + - "unit" + - "controller" + - "service" From 99edf48f8330d4f9b736d9e86124759818ec43a8 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 6 Jun 2024 17:14:19 -0400 Subject: [PATCH 2/8] adding components to the layout --- .github/workflows/pr-only.yaml | 11 ++++------- codecov.yml | 8 ++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr-only.yaml b/.github/workflows/pr-only.yaml index fe0c562..2439df8 100644 --- a/.github/workflows/pr-only.yaml +++ b/.github/workflows/pr-only.yaml @@ -78,30 +78,27 @@ jobs: run: vendor/bin/phpunit --testsuite="Services Tests" --coverage-clover=coverage-service.xml - name: Upload Service coverage report #step 3 - run: ./codecov --verbose upload-process --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} -n 'service'-${{ github.run_id }} -F service -f coverage-service.xml + run: ./codecov upload-process --disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'service'-${{ github.run_id }} -F service -f coverage-service.xml - name: Run Controller Testsuite with Coverage run: vendor/bin/phpunit --testsuite="Controllers Tests" --coverage-clover=coverage-controller.xml - name: Upload Controller coverage report - run: ./codecov --verbose upload-process --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} -n 'controller'-${{ github.run_id }} -F controller -f coverage-service.xml + run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'controller'-${{ github.run_id }} -F controller -f coverage-service.xml - name: Run Unit Testsuite with Coverage run: vendor/bin/phpunit --testsuite="Unit Tests" --coverage-clover=coverage-unit.xml - name: Upload unit coverage report - run: ./codecov --verbose upload-process --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} -n 'unit'-${{ github.run_id }} -F unit -f coverage-unit.xml + run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'unit'-${{ github.run_id }} -F unit -f coverage-unit.xml - name: Run Complete Testsuite with Coverage run: vendor/bin/phpunit --coverage-clover=coverage.xml - - name: Upload overall coverage report - run: ./codecov --verbose upload-process --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} -n 'backend'-${{ github.run_id }} -F backend -f coverage.xml - - name: Javascript tests using Jest run: npm run test - name: Upload Javascript coverage - run: ./codecov --verbose upload-process --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json + run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json \ No newline at end of file diff --git a/codecov.yml b/codecov.yml index c946502..37a1f10 100644 --- a/codecov.yml +++ b/codecov.yml @@ -27,7 +27,7 @@ github_checks: annotations: true comment: - layout: "newheader, diff, flags, files" + layout: "newheader, diff, flags, components, files" require_changes: false # if true: only post the comment if coverage changes require_base: false # [yes :: must have a base report to post] require_head: true # [yes :: must have a head report to post] @@ -64,6 +64,6 @@ component_management: paths: - ".*" flag_regexes: # List. Flags to be included in the component. - - "unit" - - "controller" - - "service" + - "unit" + - "controller" + - "service" From 00ed46195d5c9d11a3e71c619a1d97d529cb8c94 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 6 Jun 2024 17:23:21 -0400 Subject: [PATCH 3/8] adjusting yaml files --- .github/workflows/main.yaml | 16 ++++++++-------- .github/workflows/pr-only.yaml | 2 ++ codecov.yml | 7 ++++++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f2b70a6..2c1ca3c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -80,33 +80,33 @@ jobs: run: chmod +x codecov - ## RUN tests an upload reports + # RUN tests an upload reports ## comment - name: Run Service Testsuite with Coverage run: vendor/bin/phpunit --testsuite="Services Tests" --coverage-clover=coverage-service.xml - name: Upload Service coverage report #step 3 - run: ./codecov -t ${CODECOV_DD_TOKEN} --url https://codecov.io -F service -f coverage-service.xml + run: ./codecov upload-process --disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'service'-${{ github.run_id }} -F service -f coverage-service.xml - name: Run Controller Testsuite with Coverage run: vendor/bin/phpunit --testsuite="Controllers Tests" --coverage-clover=coverage-controller.xml - name: Upload Controller coverage report - run: ./codecov -t ${CODECOV_DD_TOKEN} --url https://codecov.io -F controller -f coverage-controller.xml + run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'controller'-${{ github.run_id }} -F controller -f coverage-service.xml - name: Run Unit Testsuite with Coverage run: vendor/bin/phpunit --testsuite="Unit Tests" --coverage-clover=coverage-unit.xml - name: Upload unit coverage report - run: ./codecov -t ${CODECOV_DD_TOKEN} --url https://codecov.io -F unit -f coverage-unit.xml + run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'unit'-${{ github.run_id }} -F unit -f coverage-unit.xml - name: Run Complete Testsuite with Coverage run: vendor/bin/phpunit --coverage-clover=coverage.xml - - name: Upload overall coverage report - run: ./codecov -t ${CODECOV_DD_TOKEN} --url https://codecov.io -F backend -f coverage.xml - - name: Javascript tests using Jest run: npm run test - name: Upload Javascript coverage - run: ./codecov -t ${CODECOV_DD_TOKEN} --url https://codecov.io -F javascript -f coverage/coverage-final.json \ No newline at end of file + run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json + + - name: Trigger notifications + run: ./codecov send-notifications \ No newline at end of file diff --git a/.github/workflows/pr-only.yaml b/.github/workflows/pr-only.yaml index 2439df8..e199b3f 100644 --- a/.github/workflows/pr-only.yaml +++ b/.github/workflows/pr-only.yaml @@ -101,4 +101,6 @@ jobs: - name: Upload Javascript coverage run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json + - name: Trigger notifications + run: ./codecov send-notifications \ No newline at end of file diff --git a/codecov.yml b/codecov.yml index 37a1f10..6073364 100644 --- a/codecov.yml +++ b/codecov.yml @@ -23,7 +23,7 @@ coverage: flags: - javascript -github_checks: +github_checks: #does not work if flags are configured annotations: true comment: @@ -61,9 +61,14 @@ flags: component_management: individual_components: - component_id: "backend" + name: "backend" paths: - ".*" flag_regexes: # List. Flags to be included in the component. - "unit" - "controller" - "service" + +codecov: + notify: + manual_trigger: true From d386509cf1951b8f22e8eb202cfa6b9ff8910bd4 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 6 Jun 2024 17:27:18 -0400 Subject: [PATCH 4/8] adding manual trigger and a test --- .github/workflows/main.yaml | 2 +- .github/workflows/pr-only.yaml | 2 +- resources/js/classes/person.js | 2 +- resources/js/classes/person.test.js | 16 ++++++++++------ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2c1ca3c..c102802 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -109,4 +109,4 @@ jobs: run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json - name: Trigger notifications - run: ./codecov send-notifications \ No newline at end of file + run: ./codecov t ${{ secrets.CODECOV_TOKEN }} send-notifications \ No newline at end of file diff --git a/.github/workflows/pr-only.yaml b/.github/workflows/pr-only.yaml index e199b3f..b625e04 100644 --- a/.github/workflows/pr-only.yaml +++ b/.github/workflows/pr-only.yaml @@ -102,5 +102,5 @@ jobs: run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json - name: Trigger notifications - run: ./codecov send-notifications + run: ./codecov t ${{ secrets.CODECOV_TOKEN }} send-notifications \ No newline at end of file diff --git a/resources/js/classes/person.js b/resources/js/classes/person.js index 0e7b3bc..4068835 100644 --- a/resources/js/classes/person.js +++ b/resources/js/classes/person.js @@ -35,7 +35,7 @@ } getMenuOptions() { - return ['menu options']; + return 'menu options'; } getPersonalData() { diff --git a/resources/js/classes/person.test.js b/resources/js/classes/person.test.js index 02c23df..91b77b8 100644 --- a/resources/js/classes/person.test.js +++ b/resources/js/classes/person.test.js @@ -1,23 +1,27 @@ import Person from "./person"; -var author = new Person("Ricky", "56", "The Danger", "Bobby"); +var person = new Person("Ricky", "56", "The Danger", "Bobby"); test("Person class", ()=>{ - expect(author.getName()).toBe("Ricky") + expect(person.getName()).toBe("Ricky") }) test("Person class", ()=>{ - expect(author.getNickname()).toBe("The Danger") + expect(person.getNickname()).toBe("The Danger") }) test("Person class", ()=>{ - expect(author.getLastName()).toBe("Bobby") + expect(person.getLastName()).toBe("Bobby") }) test("Person class", ()=>{ - expect(author.getEleven()).toBe(11) + expect(person.getEleven()).toBe(11) }) test("Person class", ()=>{ - expect(author.getAccessLevel()).toBe('admin'); + expect(person.getAccessLevel()).toBe('admin'); +}) + +test("Person class", ()=>{ + expect(person.getMenuOptions()).toBe('menu items'); }) \ No newline at end of file From 3332d6cb04ca399e754cfa75376d938821aaf452 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 6 Jun 2024 17:30:08 -0400 Subject: [PATCH 5/8] fixing a test --- resources/js/classes/person.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/classes/person.test.js b/resources/js/classes/person.test.js index 91b77b8..c3d6389 100644 --- a/resources/js/classes/person.test.js +++ b/resources/js/classes/person.test.js @@ -23,5 +23,5 @@ test("Person class", ()=>{ }) test("Person class", ()=>{ - expect(person.getMenuOptions()).toBe('menu items'); + expect(person.getMenuOptions()).toBe('menu options'); }) \ No newline at end of file From 8c7ca06adbec0eff5773161fbbe84c0db8693285 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 6 Jun 2024 17:32:22 -0400 Subject: [PATCH 6/8] fixing a token param --- .github/workflows/main.yaml | 2 +- .github/workflows/pr-only.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c102802..37b477f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -109,4 +109,4 @@ jobs: run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json - name: Trigger notifications - run: ./codecov t ${{ secrets.CODECOV_TOKEN }} send-notifications \ No newline at end of file + run: ./codecov -t ${{ secrets.CODECOV_TOKEN }} send-notifications \ No newline at end of file diff --git a/.github/workflows/pr-only.yaml b/.github/workflows/pr-only.yaml index b625e04..35b2268 100644 --- a/.github/workflows/pr-only.yaml +++ b/.github/workflows/pr-only.yaml @@ -102,5 +102,5 @@ jobs: run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json - name: Trigger notifications - run: ./codecov t ${{ secrets.CODECOV_TOKEN }} send-notifications + run: ./codecov -t ${{ secrets.CODECOV_TOKEN }} send-notifications \ No newline at end of file From f24863cdb5754fdd940ddcd7b27e5c067ed9ff04 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 6 Jun 2024 17:34:33 -0400 Subject: [PATCH 7/8] moving things around --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 37b477f..1e57d99 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -109,4 +109,4 @@ jobs: run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json - name: Trigger notifications - run: ./codecov -t ${{ secrets.CODECOV_TOKEN }} send-notifications \ No newline at end of file + run: ./codecov send-notifications -t ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From 7b67313d53381f9b7bf17a75a84c9de3fb84db47 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 6 Jun 2024 17:46:09 -0400 Subject: [PATCH 8/8] fixing notification command --- .github/workflows/pr-only.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-only.yaml b/.github/workflows/pr-only.yaml index 35b2268..a978241 100644 --- a/.github/workflows/pr-only.yaml +++ b/.github/workflows/pr-only.yaml @@ -102,5 +102,5 @@ jobs: run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json - name: Trigger notifications - run: ./codecov -t ${{ secrets.CODECOV_TOKEN }} send-notifications + run: ./codecov send-notifications -t ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file