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

Feature/random data provider #42

Merged
merged 58 commits into from
Jul 23, 2019
Merged

Conversation

kss-espeo
Copy link
Collaborator

No description provided.

Krzysztof Spisak-Spisacki and others added 30 commits May 29, 2019 14:53
…SO's) and made Dockerfile install SGX stuff in the container.
…om-data-provider

# Conflicts:
#	src/domain/common/usecase/FetchDataUseCase.js
#	src/domain/request/usecase/ExecuteReadyRequestsUseCase.js
#	src/index.js

...and introduced DataFetcherFactory along with a merge commit, like a complete idiot
Krzysztof Spisak-Spisacki added 5 commits July 18, 2019 15:23
…om-data-provider

# Conflicts:
#	src/application/dataFetcher/AxiosUrlDataFetcherAdapter.ts
#	src/domain/common/usecase/FetchDataUseCase.spec.ts
#	src/domain/common/usecase/FetchDataUseCase.ts
#	src/domain/request/usecase/ExecuteReadyRequestsUseCase.spec.ts
#	src/domain/request/usecase/ExecuteReadyRequestsUseCase.ts
#	src/index.ts
@kss-espeo kss-espeo marked this pull request as ready for review July 19, 2019 16:23
@kss-espeo
Copy link
Collaborator Author

kss-espeo commented Jul 19, 2019

This PR includes changes from #32 . It would be probably esaier to review after changes from #32 are in master.

Krzysztof Spisak-Spisacki added 8 commits July 19, 2019 19:37
…om-data-provider

# Conflicts:
#	src/domain/request/requestExecutor/RequestExecutorFactory.ts
…om-data-provider

# Conflicts:
#	src/domain/request/requestExecutor/RequestExecutorStrategy.spec.ts
#	src/domain/request/usecase/ExecuteReadyRequestsUseCase.ts
#	src/index.ts
Krzysztof Spisak-Spisacki added 2 commits July 22, 2019 18:54
# Conflicts:
#	src/application/dataFetcher/AxiosUrlDataFetcherAdapter.ts
#	src/domain/request/requestExecutor/RequestExecutorStrategy.spec.ts
#	src/domain/request/requestExecutor/RequestExecutorStrategy.ts
#	src/domain/request/requestExecutor/UrlRequestExecutor.ts
#	src/index.ts
Dockerfile Outdated
apt-get install curl libssl1.0-dev --yes

# Install nodejs v11
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use NodeJS version 10.16? It's the latest LTS.

package.json Outdated
@@ -59,8 +61,12 @@
"devDependencies": {
"@types/dotenv": "6.1.1",
"@types/express": "4.17.0",
"@types/ffi": "^0.2.2",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Target dependencies strictly.

import RequestUrlParser from '@core/domain/request/RequestUrlParser';
import DataFetcher from '../../domain/common/port/DataFetcherPort';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you added ../../ instead of @core?

import RandomDotOrgDataFetcherAdapter from './RandomDotOrgDataFetcherAdapter';
import {response} from './RandomDotOrgResponse';

describe('Random.org Integration Test', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this test suite is an integration one? I see that you mock here random api.

headers: {
'Content-Type': 'application/json',
},
data: `{"jsonrpc":"2.0","method":"generateIntegers","params":{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format this property properly as an object and then convert to string if needed.

id: 21686,
};

export {response};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we talk that we want to move all test fixtures to separate directory?

@@ -16,6 +16,14 @@ class Request {
getSelectionPath() {
return RequestUrlParser.resolveSelectionPath(this.url);
}

getLeftSideBound() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it's the right place for this. Not every request would have left and right side bounds (but from the code it would look like this).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not. I will move RequestUrlParser logic to RequestStrategy, along with this as well. I intend to run an enhancement task that will address couple of things like this plus add more tests around random provider feature. However I decided to postpone it because we have a feature to deliver.

@@ -28,6 +28,26 @@ class RequestUrlParser {

return wrappedUrl.substr(pathStartIndex);
}

static resolveLeftSideBound(wrappedUrl: string): string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here as above.

}

canHandle(contentType: string): boolean {
return 'random' === contentType;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This string should be extracted to some enum.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. This requires changes in many places (biggest offender is RequestUrlParser) . I plan to do that as a part of enhancement task.

Krzysztof Spisak-Spisacki added 3 commits July 23, 2019 16:20
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@kss-espeo kss-espeo merged commit 8b69119 into master Jul 23, 2019
@kss-espeo kss-espeo deleted the feature/random-data-provider branch July 23, 2019 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants