Skip to content

Commit

Permalink
Pmcb/extend timeouts (#57)
Browse files Browse the repository at this point in the history
* loading tests write to real Pod, ESLint fixes, Hobby display test added

* updated Turtle files, and YAML to use latest Artifact Generator

* more Turtle tidy ups

* extend timeouts for poor connections, fetch Pod root resource instead of private container
  • Loading branch information
pmcb55 authored Mar 30, 2023
1 parent 908c908 commit 75d764f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
8 changes: 5 additions & 3 deletions e2e/node/localExtract-TransformLoad.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe("All data sources", () => {
} else {
// Just set a higher timeout for our Pod login attempts...
custom.setHttpOptionsDefaults({
timeout: 10000,
timeout: 20000,
});

await session.login({
Expand Down Expand Up @@ -162,7 +162,9 @@ describe("All data sources", () => {
`No storage root (or just our default one for triplestore population), so not attempting to access a private resource on the ETL Tutorial Pod.`
);
} else {
const resourceIri = `${storageRoot}private/`;
// Storage root is private (and we shouldn't ever rely on any
// particular resource being present in any Pod).
const resourceIri = `${storageRoot}`;
debug(`Attempting to read PRIVATE resource [${resourceIri}]...`);
try {
const dataset = await getSolidDataset(resourceIri, {
Expand All @@ -179,7 +181,7 @@ describe("All data sources", () => {
throw new Error(message);
}
}
}, 10000);
}, 15000);
});

describe("Passport (local)", () => {
Expand Down
2 changes: 1 addition & 1 deletion jest.e2e.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
clearMocks: true,
// Because we're making HTTP requests that can take a while, tests should be
// given a little longer to complete:
testTimeout: 10000,
testTimeout: 20000,
testRegex: "e2e/node/.*.test.ts",
injectGlobals: false,
};
32 changes: 16 additions & 16 deletions src/runEtl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ describe("ETL process", () => {

const successfullyProcessed = await runEtl(validArguments);
expect(successfullyProcessed).toBe(1);
});
}, 15000);

it("should fail ETL from data source fails", async () => {
jest.requireMock(
Expand Down Expand Up @@ -200,7 +200,7 @@ describe("ETL process", () => {

const successfullyProcessed = await runEtl(validArguments);
expect(successfullyProcessed).toBe(0);
});
}, 15000);

it("should fail if looking for existing application resources throws", async () => {
jest.requireMock(
Expand Down Expand Up @@ -232,7 +232,7 @@ describe("ETL process", () => {

const successfullyProcessed = await runEtl(validArguments);
expect(successfullyProcessed).toBe(0);
});
}, 15000);

it("should fail if ETL application login fails", async () => {
const validArguments = {
Expand All @@ -250,7 +250,7 @@ describe("ETL process", () => {

const successfullyProcessed = await runEtl(validArguments);
expect(successfullyProcessed).toBe(-1);
});
}, 15000);

it("should fail on invalid credential resource", async () => {
const filename =
Expand All @@ -265,7 +265,7 @@ describe("ETL process", () => {

const successfullyProcessed = await runEtl(validArguments);
expect(successfullyProcessed).toBe(-1);
});
}, 15000);

it("should ignore specified credential resource", async () => {
const filename =
Expand All @@ -281,7 +281,7 @@ describe("ETL process", () => {

const successfullyProcessed = await runEtl(validArguments);
expect(successfullyProcessed).toBe(0);
});
}, 15000);
});

describe("Loading resources and blobs", () => {
Expand All @@ -300,7 +300,7 @@ describe("ETL process", () => {
null
)
).resolves.toContain("No Linked Data resources or Blobs to load");
});
}, 15000);

it("should report no resources to load", async () => {
const authnModule = jest.requireMock(
Expand All @@ -317,7 +317,7 @@ describe("ETL process", () => {
{ rdfResources: [], blobsWithMetadata: null }
)
).resolves.toContain("Empty set of resources to load");
});
}, 15000);
});

describe("Loading resources", () => {
Expand All @@ -338,7 +338,7 @@ describe("ETL process", () => {
[{ url: "https://example.com/test", blob: new Blob([]) }]
)
).resolves.toContain(`[${dataSource}] provided no resources`);
});
}, 15000);

it("should report Blob", async () => {
const authnModule = jest.requireMock(
Expand Down Expand Up @@ -376,7 +376,7 @@ describe("ETL process", () => {
[{ url: "https://example.com/test", blob: new Blob([]) }]
)
).resolves.toContain("and [1] Blob");
});
}, 15000);

it("should report no resources to load", async () => {
const authnModule = jest.requireMock(
Expand All @@ -393,7 +393,7 @@ describe("ETL process", () => {
[]
)
).resolves.toContain("Empty set of resources to load");
});
}, 15000);

it("should load resource, not logged into Pod", async () => {
const authnModule = jest.requireMock(
Expand All @@ -415,7 +415,7 @@ describe("ETL process", () => {
dataset,
])
).resolves.toContain("ETL tool did not log into");
});
}, 15000);

it("should load resource, logged into Pod", async () => {
const dataset = buildDataset(
Expand All @@ -438,7 +438,7 @@ describe("ETL process", () => {
dataset,
])
).resolves.toContain("Successfully inserted or updated [1] resource");
});
}, 15000);
});

describe("Log into Pod", () => {
Expand All @@ -464,7 +464,7 @@ describe("ETL process", () => {
// setting it's logged-in flag to 'true', when in fact it's passed
// 'undefined'.
expect(session.info.isLoggedIn).toBeTruthy();
});
}, 15000);

it("should fail login if registered app creds resource is invalid Turtle", async () => {
jest.requireMock(
Expand All @@ -487,7 +487,7 @@ describe("ETL process", () => {
// setting it's logged-in flag to 'true', when in fact it's passed
// 'undefined', and actually isn't logged in at all...
expect(session.info.isLoggedIn).toBeTruthy();
});
}, 15000);

it("should throw if login throws", async () => {
jest.requireMock(
Expand All @@ -505,6 +505,6 @@ describe("ETL process", () => {
await expect(loginAsRegisteredApp(validArguments)).rejects.toThrow(
"failed to log into Solid"
);
});
}, 15000);
});
});

0 comments on commit 75d764f

Please sign in to comment.