From f46f5dbce7c97f16f92707482a4a34d3801c559e Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 6 Jun 2024 20:41:46 -0400 Subject: [PATCH 1/3] Added new code and tests --- app/Models/Charge.php | 4 ++++ resources/js/classes/person.test.js | 4 ++++ tests/Unit/ChargeTest.php | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/app/Models/Charge.php b/app/Models/Charge.php index bd240ac..a8692ff 100644 --- a/app/Models/Charge.php +++ b/app/Models/Charge.php @@ -76,4 +76,8 @@ public function uncoveredFunction() { public function returnSeventySix() { return 76; } + + public function returnDataSet() { + return 'data set'; + } } diff --git a/resources/js/classes/person.test.js b/resources/js/classes/person.test.js index c3d6389..2001a21 100644 --- a/resources/js/classes/person.test.js +++ b/resources/js/classes/person.test.js @@ -24,4 +24,8 @@ test("Person class", ()=>{ test("Person class", ()=>{ expect(person.getMenuOptions()).toBe('menu options'); +}) + +test("Person class", ()=>{ + expect(person.getPersonalData()).toBe('secret data'); }) \ No newline at end of file diff --git a/tests/Unit/ChargeTest.php b/tests/Unit/ChargeTest.php index 2911e47..ecfb30e 100644 --- a/tests/Unit/ChargeTest.php +++ b/tests/Unit/ChargeTest.php @@ -35,4 +35,11 @@ public function testReturnSeventySix() { $result = $charge->returnSeventySix(); $this->assertEquals(76, $result); } + + public function testReturnDataSet() { + + $charge = Charge::factory()->make(); + $result = $charge->returnDataSet(); + $this->assertEquals('data set', $result); + } } From 71b0095835111b9cf2082ad85f9e8b6ffe4bbc44 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 6 Jun 2024 20:49:24 -0400 Subject: [PATCH 2/3] removing an extra test. disabling search --- .github/workflows/pr-only.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-only.yaml b/.github/workflows/pr-only.yaml index 4b9b3ad..08b3943 100644 --- a/.github/workflows/pr-only.yaml +++ b/.github/workflows/pr-only.yaml @@ -86,22 +86,19 @@ jobs: run: vendor/bin/phpunit --testsuite="Controllers Tests" --coverage-clover=coverage-controller.xml - name: Upload Controller coverage report - run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'controller'-${{ github.run_id }} -F controller -f coverage-service.xml + run: ./codecov upload-process -disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'controller'-${{ github.run_id }} -F controller -f coverage-controller.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 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 + run: ./codecov upload-process -disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'unit'-${{ github.run_id }} -F unit -f coverage-unit.xml - name: Javascript tests using Jest run: npm run test - name: Upload Javascript coverage - run: ./codecov upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json + run: ./codecov upload-process -disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json - name: Trigger notifications run: ./codecov send-notifications -t ${{ secrets.CODECOV_TOKEN }} From c04e8f0076d8c735c074676de6b26dd916a93d87 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 6 Jun 2024 20:57:04 -0400 Subject: [PATCH 3/3] fixing syntax --- .github/workflows/pr-only.yaml | 6 +++--- codecov.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-only.yaml b/.github/workflows/pr-only.yaml index 08b3943..63b0f12 100644 --- a/.github/workflows/pr-only.yaml +++ b/.github/workflows/pr-only.yaml @@ -86,19 +86,19 @@ jobs: run: vendor/bin/phpunit --testsuite="Controllers Tests" --coverage-clover=coverage-controller.xml - name: Upload Controller coverage report - run: ./codecov upload-process -disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'controller'-${{ github.run_id }} -F controller -f coverage-controller.xml + run: ./codecov upload-process --disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'controller'-${{ github.run_id }} -F controller -f coverage-controller.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 upload-process -disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'unit'-${{ github.run_id }} -F unit -f coverage-unit.xml + run: ./codecov upload-process --disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'unit'-${{ github.run_id }} -F unit -f coverage-unit.xml - name: Javascript tests using Jest run: npm run test - name: Upload Javascript coverage - run: ./codecov upload-process -disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json + run: ./codecov upload-process --disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'javascript'-${{ github.run_id }} -F 'javascript' -f coverage/coverage-final.json - name: Trigger notifications run: ./codecov send-notifications -t ${{ secrets.CODECOV_TOKEN }} diff --git a/codecov.yml b/codecov.yml index 6073364..11ed7aa 100644 --- a/codecov.yml +++ b/codecov.yml @@ -64,7 +64,7 @@ component_management: name: "backend" paths: - ".*" - flag_regexes: # List. Flags to be included in the component. + flag_regexes: # List of lags to be included in the component. - "unit" - "controller" - "service"