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

Fix tests #271

Merged
merged 2 commits into from
Feb 19, 2024
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
2 changes: 1 addition & 1 deletion src/test/integration/computeFees.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('Compute provider fees', async () => {
files: [
{
type: 'url',
url: 'https://github.com/datablist/sample-csv-files/raw/main/files/organizations/organizations-100.csv',
url: 'https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt',
mariacarmina marked this conversation as resolved.
Show resolved Hide resolved
method: 'GET'
}
]
Expand Down
2 changes: 1 addition & 1 deletion src/test/integration/download.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('Download Tests', () => {
files: [
{
type: 'url',
url: 'https://github.com/datablist/sample-csv-files/raw/main/files/organizations/organizations-100.csv',
url: 'https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt',
method: 'GET'
}
]
Expand Down
8 changes: 4 additions & 4 deletions src/test/unit/storage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ describe('URL Storage getFileInfo tests', () => {
before(() => {
storage = new UrlStorage({
type: 'url',
url: 'https://github.com/datablist/sample-csv-files/raw/main/files/organizations/organizations-100.csv',
url: 'https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt',
method: 'get'
})
})
Expand All @@ -241,9 +241,9 @@ describe('URL Storage getFileInfo tests', () => {
const fileInfo = await storage.getFileInfo(fileInfoRequest)

assert(fileInfo[0].valid, 'File info is valid')
expect(fileInfo[0].contentLength).to.equal('13873')
expect(fileInfo[0].contentType).to.equal('text/plain')
expect(fileInfo[0].name).to.equal('organizations-100.csv')
expect(fileInfo[0].contentLength).to.equal('138486')
expect(fileInfo[0].contentType).to.equal('text/plain; charset=utf-8')
expect(fileInfo[0].name).to.equal('shs_dataset_test.txt')
expect(fileInfo[0].type).to.equal('url')
})

Expand Down
3 changes: 2 additions & 1 deletion src/utils/logging/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ export class CustomOceanNodesTransport extends Transport {

try {
// Use the insertLog method of the LogDatabase instance
if (this.dbInstance) {
if (this.dbInstance && this.dbInstance.logs) {
// double check before writing
await this.dbInstance.logs.insertLog(document)
}
} catch (error) {
Expand Down
Loading