-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support OGC API - Processes - Part 1: Core #51
Support OGC API - Processes - Part 1: Core #51
Conversation
2a7bcc0
to
442d7d4
Compare
@haoliangyu Sorry for generating so much noise today with actions. I had some problems setting up a local pygeoapi instance for e2e tests. This should be fixed now. I will create a separate PR which will add a Dockerfile, which builds a custom pygeoapi instance, which then will be used as backend for e2e tests. |
1f3368d
to
a2903cc
Compare
a2903cc
to
b7232a7
Compare
b7232a7
to
64cf98e
Compare
@haoliangyu e2e tests are almost complete. I just wait for some feedback on geopython/pygeoapi#1383. I would be grateful, when you may find the time for a review, because this PR brings a lot changes with it. In other words: A second opinion does not hurt here. :-) |
This is an important feature update and I can allocate some time this or next week for review. |
@@ -27,10 +27,10 @@ This library uses the global [fetch](https://fetch.spec.whatwg.org/) function fo | |||
``` javascript | |||
require('isomorphic-fetch'); | |||
|
|||
const { Service } = require('@ogcapi-js/features'); | |||
const { FeatureService } = require('@ogcapi-js/features'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new major version bump is required due to the name change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the name because I think FeatureService
is more specific than Service
. In addition it will avoid import aliases for consumers, which want to use the features and the process package together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have checked the latest release (0.5.0
) and this breaking change has already been implemented there, but the corresponding README was not updated accordingly. This change does this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I am not aware of that change. I will still plan to release it as v1.
require('isomorphic-fetch'); | ||
|
||
const TEST_SITE = 'https://demo.ldproxy.net/vineyards'; | ||
const TEST_SITE = 'http://localhost:5000'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes how the e2e tests run. Can you provide an instruction in the packages/features/README.md on how to run e2e locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure, I will update the README.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have attached the instructions to run E2E tests locally to the root README of this library, because those instructions apply to both features and processes.
test('e2e: getJobs() should return a jobs list', async () => { | ||
const service = new ProcessesService({ baseUrl: TEST_SITE }); | ||
const result = await service.getJobs(); | ||
|
||
expect(Array.isArray(result.jobs)).toBe(true); | ||
result.jobs.forEach(job => { | ||
expect(job.processID).toBe('hello-world'); | ||
expect(job.status).toBe('successful'); | ||
}); | ||
}); | ||
|
||
test('e2e: getJob() should return a job', async () => { | ||
const service = new ProcessesService({ baseUrl: TEST_SITE }); | ||
const result = await service.getJob('f78fa304-775f-11ee-88b4-0242ac110002'); | ||
|
||
expect(result).toBeDefined(); | ||
expect(result.processID).toBe('hello-world'); | ||
expect(result.status).toBe('successful'); | ||
expect(result.jobID).toBe('f78fa304-775f-11ee-88b4-0242ac110002'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does these two e2e tests depend on the previous executeJob
e2e test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they do not depend on the previous executeJob()
tests, because the e2e docker image contains a pre-populated jobs database.
But the assertions inside the getJobs()
for loop should be less specific. I will improve this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are improved.
@haoliangyu requested changes are implemented. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
This PR implements OGC API - Porcesses - Part 1: Core.
Implementation is basically ready, but e2e tests need some tweaking.
Closes #30.