Skip to content

Commit

Permalink
BREAKING CHANGE: enforce code coverage and test suite failures (#729)
Browse files Browse the repository at this point in the history
* BREAKING CHANGE: enforce code coverage

Previously code coverage seems to have not been enforced.
To add to the hilarity, no one seems to have caught on, or
cared. Maybe they are wiser than me, because code coverage seems
to be a very blunt tool which forces people to care about its
letter rather than the intent, and usually makes people write
silly pointless tests, probably because the coverage numbers are
set too high.

Anyway, more to the point, runCLI is an undocumented API. Hence
this is not even the right fix. The right fix would be to stop
using an undocumented API, and instead use it as it was designed,
which I think means via shell script. I'm not pursuing that out
of time constraints, but I see it as far superior. Using
undocumented features makes it more likely that they will be used
incorrectly (as was being done here.). Also -- why wasn't this
ever tested to see that it worked? Maybe I'm missing something
super obvious here :|

I did not rely on any documentation for this fix, because there
are no official docs, but it seems like this is the right solution,
and it was very easy to test.

This is a breaking change because any repo which is using ds-cli
and ignoring code coverage -- probably most of them -- will stop
working once this change is made. If ds-cli were not in use by anyone,
I would call it a patch update, but as it is, this instantly breaks
any consumers that think their coverage is working and never looked
at their logs. So I think a major version update is warranted, as
a warning.

* feat:  ignore .idea; specify that node-gyp errors are not blocking

-Ignore JetBrains IDE-specific files
-Specify that even if Node-gyp throws out errors (... errors that
do not end in "ok" :/ ), the build may still work.
  • Loading branch information
corp-ray authored Oct 5, 2023
1 parent 5cd4892 commit 00b4dda
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea/**

# These files are generated
packages/docs/src/generated

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Ensure you have the following softwares installed:
* `Node >= 10.18.1` - [Installation guide](https://nodejs.org/en/download/)
* `Yarn` - [Installation guide](https://classic.yarnpkg.com/en/docs/install)

If node-gyp throws errors during installation, installation may still be successful

### To get started:

To get set up, fork and clone the project then run the following command:
Expand Down
2 changes: 1 addition & 1 deletion plugins/test/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class TestPlugin implements Plugin<TestArgs> {
await createJestAnnotations(results);
}

if (results.numFailedTests > 0) {
if (!results.success) {
process.exit(1);
}
} catch (e) {
Expand Down

0 comments on commit 00b4dda

Please sign in to comment.