Skip to content

Commit

Permalink
Renamed pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Darien Pardinas Diaz committed May 20, 2024
1 parent 4aa33fc commit ef30795
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml → .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: CI/CD pipeline
on:
pull_request:
push:
Expand All @@ -8,7 +8,7 @@ on:

jobs:
build:
name: "Build and release"
name: "Build, test and release"
runs-on: ubuntu-latest

steps:
Expand All @@ -22,7 +22,7 @@ jobs:
run: npm install

- name: Build and run automation tests
run: xvfb-run -a npm run test
run: npm run test

- name: Publish to VSCode Marketplace
if: ${{ github.ref == 'refs/heads/main' }}
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"type": "extensionHost",
"request": "launch",
"args": [
"${workspaceFolder}/test/workspace1",
"${workspaceFolder}/src/test/workspace1",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## [0.0.5]

- Added `custom.workspaceFile` and `custom.workspaceFolders` to retrieve the workspace file (if any) and folders currently opened in the workspace (if any)

- Added `custom.getCommands` to retrieve the full list of commands registered within vscode

## [0.0.4]

- Removed npm vulnerabilities
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const startHttpServer = async (
processRemoteControlRequest(reqData as ControlRequest)
.then((data) => {
res.setHeader("Content-Type", "application/json");
res.write(JSON.stringify(data || {}));
res.write(JSON.stringify(data || null));
res.end();
})
.catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function main() {
const extensionTestsPath = path.resolve(__dirname, "./suite/index");

// Get the directory path to a sample workspace
const workspace1 = path.resolve(__dirname, "./workspace1");
const workspace1 = path.resolve(extensionDevelopmentPath, "src/test/workspace1");

// VSCode launch arguments
const launchArgs = [workspace1];
Expand Down
3 changes: 3 additions & 0 deletions src/test/suite/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ suite("Extension Test Suite", () => {
assert(ws.index === 0);
assert(ws.uri.startsWith("file://"));
assert(ws.uri.endsWith("/workspace1"));

const workspaceFile = await makeRequest("custom.workspaceFile") as any;
assert(workspaceFile === null); // no workspace file
});

test("get all commands registred in vscode", async () => {
Expand Down
4 changes: 3 additions & 1 deletion src/test/workspace1/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
from time import sleep


def post_data(data, url="http://localhost:37100"):
def post_data(data):
port = os.environ.get("REMOTE_CONTROL_PORT", "37100")
url = f"http://localhost:{port}"
body = json.dumps(data).encode("utf-8")
headers = {"Content-Type": "application/json"}
req = request.Request(url, body, headers)
Expand Down
2 changes: 1 addition & 1 deletion src/test/workspace1/samples.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@endpoint = http://localhost:43285
@endpoint = http://localhost:37100

### show a warning message in vscode and get a choice selection
POST {{endpoint}} HTTP/1.1
Expand Down

0 comments on commit ef30795

Please sign in to comment.