-
Notifications
You must be signed in to change notification settings - Fork 6.1k
refactor: move integration tests to Jest #5275
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
d76d700
feat: add installExtension integration test
jsjoeio 76b4e3c
refactor: s/ test:standalone with test:integration
jsjoeio 7e19b73
refactor: filter unit tests
jsjoeio a956a41
refactor: add SKIP_SUBMODULE_DEPS to postinstall
jsjoeio f149e14
refactor: add SKIP_SUBMODULE_DEPS to postinstall
jsjoeio ada0fd3
fixup!: skip submod deps
jsjoeio 880ac2a
refactor: move runCodeServerCommand into sep. file
jsjoeio 566d29a
fizup: formatting
jsjoeio 7c96c97
fizup: increase timeout
jsjoeio 86d29eb
refactor: use fixture in installExtension test
jsjoeio acdb3a2
feat: add integration test for listExtensions
jsjoeio af300c6
chore: ignore integration fixtures
jsjoeio 4c0b5d9
fixup: formatting
jsjoeio 395283b
fixup: remove custom-hacks.css
jsjoeio f76acab
fixup: formatting
jsjoeio da4f1f2
Update test/integration/installExtension.test.ts
jsjoeio 233c226
Update test/integration/listExtensions.test.ts
jsjoeio eca5e2f
Update test/integration/installExtension.test.ts
jsjoeio 5df0fda
Update test/integration/listExtensions.test.ts
jsjoeio 08bb492
fixup: contributing integration tests section
jsjoeio ca6b445
fixup: update ci/readme
jsjoeio 529ed08
fixup: use RELEASE_PATH in test-integration.sh
jsjoeio 0ffc0e5
refactor: unzip vsix for listExtensions
jsjoeio 73f043a
refactor: use exec instead of spawn
jsjoeio a0eb6bc
Update docs/CONTRIBUTING.md
jsjoeio f3c78ca
Update test/integration/listExtensions.test.ts
jsjoeio ee7d294
Update test/integration/listExtensions.test.ts
jsjoeio 51b9196
Update test/integration/listExtensions.test.ts
jsjoeio 79f6060
refactor: use different default binary path
jsjoeio 025b785
fixup!: formatting
jsjoeio 53e82a6
fixup: lint
jsjoeio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ jobs: | |
run: ./install.sh | ||
|
||
- name: Test code-server | ||
run: yarn test:standalone-release code-server | ||
run: CODE_SERVER_PATH="code-server" yarn test:integration | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we install code-server in these steps, we need to tell the integration tests to look at |
||
|
||
alpine: | ||
name: Test installer on Alpine | ||
|
@@ -66,4 +66,4 @@ jobs: | |
run: ./install.sh | ||
|
||
- name: Test code-server | ||
run: yarn test:standalone-release code-server | ||
run: CODE_SERVER_PATH="code-server" yarn test:integration |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
help() { | ||
jsjoeio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo >&2 " You can build the standalone release with 'yarn release:standalone'" | ||
echo >&2 " Or you can pass in a custom path." | ||
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' yarn test:integration" | ||
} | ||
|
||
# Make sure a code-server release works. You can pass in the path otherwise it | ||
# will look for release-standalone in the current directory. | ||
# | ||
# This is to make sure we don't have Node version errors or any other | ||
# compilation-related errors. | ||
main() { | ||
cd "$(dirname "$0")/../.." | ||
|
||
local path="./release-standalone/bin/code-server" | ||
jsjoeio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if [[ ! ${CODE_SERVER_PATH-} ]]; then | ||
echo "Set CODE_SERVER_PATH to test another build of code-server" | ||
else | ||
path="$CODE_SERVER_PATH" | ||
fi | ||
|
||
echo "Running tests with code-server binary: '$path'" | ||
|
||
if [[ ! -f $path ]]; then | ||
echo >&2 "No code-server build detected" | ||
echo >&2 "Looked in $path" | ||
help | ||
exit 1 | ||
fi | ||
|
||
CODE_SERVER_PATH="$path" CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" --coverage=false --testRegex "./test/integration" --testPathIgnorePatterns "./test/integration/fixtures" | ||
} | ||
|
||
main "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
44 changes: 44 additions & 0 deletions
44
test/integration/fixtures/wesbos.theme-cobalt2-2.1.6/.vsixmanifest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
jsjoeio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011"> | ||
<Metadata> | ||
<Identity Language="en-US" Id="theme-cobalt2" Version="2.1.6" Publisher="wesbos"/> | ||
<DisplayName>Cobalt2 Theme Official</DisplayName> | ||
<Description xml:space="preserve">🔥 Official theme by Wes Bos.</Description> | ||
<Tags>VSCode,Themes,theme,color-theme</Tags> | ||
<Categories>Themes</Categories> | ||
<GalleryFlags>Public</GalleryFlags> | ||
<Badges></Badges> | ||
<Properties> | ||
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="^1.15.0" /> | ||
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="" /> | ||
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="" /> | ||
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="ui,workspace,web" /> | ||
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="" /> | ||
|
||
<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="https://github.com/wesbos/cobalt2-vscode" /> | ||
<Property Id="Microsoft.VisualStudio.Services.Links.Getstarted" Value="https://github.com/wesbos/cobalt2-vscode" /> | ||
|
||
<Property Id="Microsoft.VisualStudio.Services.Links.GitHub" Value="https://github.com/wesbos/cobalt2-vscode" /> | ||
|
||
|
||
|
||
|
||
<Property Id="Microsoft.VisualStudio.Services.Branding.Color" Value="#193549" /> | ||
<Property Id="Microsoft.VisualStudio.Services.Branding.Theme" Value="dark" /> | ||
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="true" /> | ||
|
||
|
||
|
||
</Properties> | ||
<License>extension/LICENSE.txt</License> | ||
<Icon>extension/images/logo.png</Icon> | ||
</Metadata> | ||
<Installation> | ||
<InstallationTarget Id="Microsoft.VisualStudio.Code"/> | ||
</Installation> | ||
<Dependencies/> | ||
<Assets> | ||
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" /> | ||
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.License" Path="extension/LICENSE.txt" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Icons.Default" Path="extension/images/logo.png" Addressable="true" /> | ||
</Assets> | ||
</PackageManifest> |
21 changes: 21 additions & 0 deletions
21
test/integration/fixtures/wesbos.theme-cobalt2-2.1.6/LICENSE.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Wes Bos, Roberto Achar | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
73 changes: 73 additions & 0 deletions
73
test/integration/fixtures/wesbos.theme-cobalt2-2.1.6/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Cobalt2 Theme for VS Code | ||
|
||
[](https://marketplace.visualstudio.com/items?itemName=wesbos.theme-cobalt2) | ||
|
||
 | ||
|
||
# Installation | ||
|
||
1. Open **Extensions** sidebar panel in VS Code. `View → Extensions` | ||
2. Search for `Cobalt2` - find the one by **Wes Bos** - there are a few other half-baked ones so make sure you have the right one! | ||
3. Click **Install** to install it. | ||
4. Click **Reload** to reload the your editor | ||
5. Code > Preferences > Color Theme > **Cobalt2** | ||
6. Optional: Use the recommended settings below for best experience | ||
|
||
## Recommended Settings | ||
|
||
```js | ||
{ | ||
"workbench.colorTheme": "Cobalt2", | ||
// The Cursive font is operator Mono, it's $200 and you need to buy it to get the cursive | ||
"editor.fontFamily": "Operator Mono, Menlo, Monaco, 'Courier New', monospace", | ||
"editor.fontSize": 17, | ||
"editor.lineHeight": 25, | ||
"editor.letterSpacing": 0.5, | ||
"files.trimTrailingWhitespace": true, | ||
"editor.fontWeight": "400", | ||
"prettier.eslintIntegration": true, | ||
"editor.cursorStyle": "line", | ||
"editor.cursorWidth": 5, | ||
"editor.cursorBlinking": "solid", | ||
"editor.renderWhitespace": "all", | ||
} | ||
``` | ||
|
||
## Contributing | ||
|
||
This is a bit weird, but to get some sort of live feedback for when editing a theme. Please let me know if you have a saner way of doing it | ||
|
||
1. Open this repo in your terminal and type `npm install` | ||
1. Start to watch for change on the repo with `npm start` - this runs a nodemon task for you and will automatically recompile any changes | ||
1. Open this repo in VS Code | ||
1. Open your command palette and hit type **VSIX**. Select the one that says **Extensions: Install from VSIX...** | ||
1. Load the VSIX file that was created a few steps back | ||
1. Set your editor to use _this_ Cobalt2 theme - it might help to change the name in package.json to something like "Cobalt2 Dev" so you can differentiate from the Cobalt2 you've installed from the marketplace. If you get confused, just delete all traces of Cobalt2 and then load the VSIX. | ||
1. Go to the debug sidebar `View → Debug` | ||
1. Press the green arrow beside "Launch Extension" | ||
1. This will then open a second window. | ||
1. Make a change, and then hit the refresh button on your debug toolbar - this is in your first editor - not the one that poped open. | ||
1. Wait a sec, your changes should now be reflected! | ||
|
||
Whew. Again, if you have an easier way to style these things, let me know! | ||
|
||
## I don't like something | ||
|
||
First, this theme is new so if something is funky, please open an issue. | ||
|
||
These are the things we have control over. If you would like to change something, you can either open a PR and see if I'd like it added, or override the colours in your own settings.json file. | ||
|
||
https://code.visualstudio.com/docs/getstarted/theme-color-reference | ||
|
||
## Put Cobalt2 in other places! | ||
|
||
- [Sublime Text](https://github.com/wesbos/cobalt2) | ||
- [Atom](https://github.com/wesbos/Cobalt2-atom) | ||
- [iTerm2](https://github.com/wesbos/Cobalt2-iterm) | ||
- [Hyper Term](https://github.com/wesbos/hyperterm-cobalt2-theme) | ||
- [Alfred](https://github.com/wesbos/Cobalt2-Alfred-Theme) | ||
- [Slack](https://github.com/wesbos/Cobalt2-Slack) | ||
|
||
## Thanks | ||
|
||
Thanks to Roberto Achar for doing much of the initial porting to VS Code. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions
50
test/integration/fixtures/wesbos.theme-cobalt2-2.1.6/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "theme-cobalt2", | ||
"version": "2.1.6", | ||
"displayName": "Cobalt2 Theme Official", | ||
"description": "🔥 Official theme by Wes Bos.", | ||
"publisher": "wesbos", | ||
"icon": "images/logo.png", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/wesbos/cobalt2-vscode" | ||
}, | ||
"galleryBanner": { | ||
"color": "#193549", | ||
"theme": "dark" | ||
}, | ||
"categories": [ | ||
"Themes" | ||
], | ||
"keywords": [ | ||
"VSCode", | ||
"Themes" | ||
], | ||
"engines": { | ||
"vscode": "^1.15.0" | ||
}, | ||
"scripts": { | ||
"start": "nodemon --exec vsce package" | ||
}, | ||
"contributes": { | ||
"themes": [ | ||
{ | ||
"label": "Cobalt2", | ||
"uiTheme": "vs-dark", | ||
"path": "./theme/cobalt2.json" | ||
} | ||
] | ||
}, | ||
"devDependencies": { | ||
"nodemon": "^1.14.12", | ||
"vsce": "^1.36.2" | ||
}, | ||
"__metadata": { | ||
"id": "fb374ce1-5343-46c8-a425-900fdad15523", | ||
"publisherDisplayName": null, | ||
"publisherId": "ef56c328-1595-4d1e-9e0b-43d926331358", | ||
"isPreReleaseVersion": false, | ||
"preRelease": false, | ||
"installedTimestamp": 1655919021078 | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.