Skip to content

fix tests that are failing on github ci #36

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 9 commits into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
fail-fast: false
matrix:
version: [22.x, 20.x, 18.x]
os: [sfdc-hk-ubuntu-latest, sfdc-hk-windows-latest]
os:
[sfdc-hk-ubuntu-latest, sfdc-hk-macos-latest, sfdc-hk-windows-latest]
name: Node ${{ matrix.version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"priority": 2,
"request": {
"method": "GET",
"urlPath": "/services/data/v56.0/jobs/query/7508Z00000lTqQCQA0/results"
Expand Down
1 change: 1 addition & 0 deletions mappings/bulk-api-query-get-more-results.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"priority": 1,
"request": {
"method": "GET",
"urlPath": "/services/data/v56.0/jobs/query/7508Z00000lTqQCQA0/results",
Expand Down
1 change: 1 addition & 0 deletions mappings/bulk-api-query-get-results-server-error.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"priority": 1,
"request": {
"method": "GET",
"urlPath": "/services/data/v56.0/jobs/query/7508Z00000lTqQCQA0/results",
Expand Down
6 changes: 3 additions & 3 deletions mappings/data-api-create-invalid-token-session-error.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"urlPath": "/services/data/v51.0/sobjects/Account"
},
"response": {
"status": 400,
"status": 401,
"headers": {
"Content-Type": "application/json;charset=UTF-8"
},
"jsonBody": {
"errorCode": "NOT_FOUND",
"message": "blah"
"errorCode": "INVALID_SESSION_ID",
"message": "Session expired or invalid"
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "tsc -b",
"lint": "eslint . --ext .ts --max-warnings 0 --report-unused-disable-directives --format codeframe",
"lint:fix": "npm run lint -- --fix",
"wiremock": "wiremock --port 8080 --bind-address 127.0.0.1 --disable-banner",
"wiremock": "JAVA_OPTS='-Xmx1024m -Xms512m' wiremock --port 8080 --bind-address 127.0.0.1 --disable-banner",
"mocha": "mocha",
"test": "cross-env NODE_ENV=test TS_NODE_PROJECT=tsconfig.test.json concurrently -k -s first \"wiremock\" \"mocha\"",
"test:coverage": "nyc --reporter=lcov --reporter=text-summary yarn test",
Expand Down
14 changes: 12 additions & 2 deletions test/sdk/bulk-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ describe("bulkApi", function () {
describe("ingest", () => {
beforeEach(async () => {
await resetScenarios();
await clearScenarioMemory();
});

it("ingesting a small dataset", async () => {
Expand Down Expand Up @@ -705,8 +706,7 @@ describe("bulkApi", function () {
]);
});

// TODO: This is getting skipped because it only fails in ubuntu, it falls back incorrectly.
it.skip("should be possible to get more results for a query job and specify the maximum records to return", async () => {
it("should be possible to get more results for a query job and specify the maximum records to return", async () => {
const currentResults: QueryJobResults = {
locator: "MjAwMOMG",
done: false,
Expand Down Expand Up @@ -1075,6 +1075,16 @@ async function setScenarioState(name: string, state: string): Promise<void> {
}
}

async function clearScenarioMemory() {
const res = await fetch(`${WIREMOCK_URL}/__admin/requests`, {
method: "DELETE",
});

if (!res.ok) {
throw new Error(`could not clear wiremock scenario memory`);
}
}

async function resetScenarios() {
const res = await fetch(`${WIREMOCK_URL}/__admin/scenarios/reset`, {
method: "POST",
Expand Down
3 changes: 1 addition & 2 deletions test/sdk/data-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ describe("DataApi Class", async () => {
});

describe("invalid token", async () => {
// TODO: skipping because this doesn't appear possible, how is the promise be rejected but the req return a body?
it.skip("throws an invalid session error", async () => {
it("throws an invalid session error", async () => {
try {
await dataApiInvalidToken.create({
type: "Account",
Expand Down
Loading