+
Skip to content

Conversation

mykhailiukVitalii
Copy link
Contributor

@mykhailiukVitalii mykhailiukVitalii commented Aug 29, 2025

Coverage task v1 updates:

  • a new Coverage class
  • review Coverage class + combine filter & coverage to one run section
  • compare current branch with master??? - WIP
  • example of coverage.yml file??? - WIP
  • create a new test plan at the end??? - WIP

Short Coverage task description:

Example:

  • command: TESTOMATIO_URL=http://xxx TESTOMATIO=tstxxx npx start-test-run -c 'npx codeceptjs run' --coverage 'filepath:coverage/coverage.yml'
  • coverage.yml file example:
// coverage.yml
todomvc-tests/helpers/**:
  - "@S171a8408"
  - "@T091ed49e"
todomvc-tests/edit-todos_test.js:
  - "@T091ed49e"
todomvc-tests/pages/**/*.js:
  - "tag:@step-06"
  - "@Safaa0ab4"
Screenshot-coverage-example-1-2-blure

@mykhailiukVitalii mykhailiukVitalii self-assigned this Aug 29, 2025
@mykhailiukVitalii mykhailiukVitalii added the enhancement New feature or request label Aug 29, 2025
@mykhailiukVitalii
Copy link
Contributor Author

mykhailiukVitalii commented Sep 1, 2025

Latest updates:

  • new execution command = filepath:coverage.yml,changes:committed - [changes options: "committed" or "uncommitted"]
  • by default we use git diff --name-only Git command
  • if by committed changes git show --name-only --pretty="" HEAD
  • we can get list of changes by {N} commit??? - WIP

Example of commands:

  • By changes from the latest commit -> npx start-test-run -c 'npx codeceptjs run' --coverage 'filepath:coverage/coverage.yml,changes:committed'
  • By uncommitted changes -> npx start-test-run -c 'npx codeceptjs run' --coverage 'filepath:coverage/coverage.yml,changes:uncommitted'
Screenshot-coverage-example-2-1

@mykhailiukVitalii mykhailiukVitalii changed the title DRAFT [COVERAGE REPORTER TASK] Expand start-test comand by coverage-mode [COVERAGE REPORTER TASK] Expand start-test comand by coverage-mode Sep 1, 2025
@DavertMik
Copy link
Contributor

DavertMik commented Sep 4, 2025

The example should be like this:

// coverage.yml
app/models:
  - "@S171a8408"
  - "@T091ed49e"
app/features/login:
  - "@T091ed49e"
lib/ui/*:
  - "tag:@step-06"
  - "@Safaa0ab4"

@mykhailiukVitalii
Copy link
Contributor Author

I think I covered all of these cases (provided by you), in my latest fixes... but I'll check again and add some additional screenshots later. Thx for your feedback @DavertMik

Check Michael example - WIP

@mykhailiukVitalii
Copy link
Contributor Author

mykhailiukVitalii commented Sep 6, 2025

I want to add a new option to get not only last Git committed/uncommitted updates, but committed by {N} (up to 10) - WIP
Example of command - --coverage 'filepath:coverage/coverage.yml,changes:committed-2'

Behavior Summary table of possible command:

Option Git command
uncommitted ✅ git diff --name-only
committed ✅ git show --name-only --pretty="" HEAD
committed-2 ✅ git show --name-only --pretty="" HEAD~2
committed-0 ❌ Error: N must be between 1 and 10
committed-11 ❌ Error: N must be between 1 and 10
committed-abc ❌ Error: Invalid format
committed-@ ❌ Error: Invalid format
random ❌ Error: Invalid changes option

@mykhailiukVitalii
Copy link
Contributor Author

In your example of coverage file I really don't understand difference between lines:

lib/ui:
  - "@T091ed49e"

AND

lib/ui/*:
  - "tag:@step-06"
  - "@Safaa0ab4"

In my code I added minimatch npm lib which check all standard glob patterns.
If you provide more examples, I can do needed fix @DavertMik

@mykhailiukVitalii
Copy link
Contributor Author

Check package.json updates - WIP (need to double check)

@DavertMik
Copy link
Contributor

To find all files via thus pattern

todomvc-tests/helpers/**:

we need to use

const files = glob.sync('todomvc-tests/helpers/**:') 

@DavertMik
Copy link
Contributor

DavertMik commented Sep 9, 2025

  1. cleanup cli.js
  2. move coverage to pipe
  3. introduce filter syntax:
npx @testomatio/reporter run "npx jest" --filter "coverage:file=testomatio-coverage.yml,diff=main"
npx @testomatio/reporter run "npx jest" --filter "coverage:diff=main,file=testomatio-coverage.yml"
npx @testomatio/reporter run "npx jest" --filter "coverage:changed"
  1. remove hardcoded lines from client.js (94-97). Ensure other pipes returning null won't stop tests from executing.
      const result = results.filter(p => p.pipe.includes('Testomatio'))[0]?.result;

      if (!result || result.length === 0) {
        return;
      }
  1. use diff to branch tracking:
git diff <branachname> --name-only

Optionally add new pipe Changes that will run only tests changed in current branch compared to main
(subset of automated tests which were changed)



npx @testomatio/reporter run "npx playwright" --filter "changes:files=test/**.test.ts,diff=main"

@mykhailiukVitalii mykhailiukVitalii changed the title [COVERAGE REPORTER TASK] Expand start-test comand by coverage-mode DRAFT: [COVERAGE REPORTER TASK] Expand start-test comand by coverage-mode Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载