Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: skip infoview breaking test on major version bump #459

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lean4-infoview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"watch": "rollup --config --environment NODE_ENV:development --watch",
"build": "rollup --config --environment NODE_ENV:production",
"watchTest": "npm run watch",
"test": "tsc -p test/tsconfig.json"
"test": "test/run-tests.sh"
},
"exports": {
".": "./dist/index.development.js",
Expand Down
18 changes: 18 additions & 0 deletions lean4-infoview/test/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

PUBLISHED_VERSION="$(npm view @leanprover/infoview-api version --no-workspaces)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be the infoview-api version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it's supposed to be @leanprover/infoview, my bad!

NEW_VERSION="$(sed -n 's/^\s*"version":\s*"\(.*\)",\s*/\1/p' ./package.json)"
PUBLISHED_MAJOR="$(cut -d '.' -f 1 <<< $PUBLISHED_VERSION)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the first component of the semantic version is 0, then the major version is the second component of the semantic version. This will yield a major version of 0 for 0.7.0, but it should be 7.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thouht semantic versioning is usually Major-Minor-Patch. is your scheme ...-Major-Minor, i.e would it be fine to always check the first two terms?

Can fix that tomorrow

NEW_MAJOR="$(cut -d '.' -f 1 <<< $NEW_VERSION)"

if [ $PUBLISHED_MAJOR == $NEW_MAJOR ]; then
tsc -p test/tsconfig.json
else
echo "Skipping breaking.ts test as major version got bumped from $PUBLISHED_MAJOR to $NEW_MAJOR!"
tsc -p test/tsconfig-breaking.json
fi

# exit if the above command failed
if [ $? -ne 0 ]; then
exit 1
fi
8 changes: 8 additions & 0 deletions lean4-infoview/test/tsconfig-breaking.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig",
"compilerOptions": {
"rootDir": "../"
},
"include": ["./**/*", "../src/**/*"],
"exclude": ["./breaking.ts"]
}
Loading