Closed jeremi closed 3 days ago
@jeremi https://community.openfn.org/t/testing-new-adaptor-on-local-environment-with-lightning/331/2 there is no way to test local adaptor on local Lightning running, confirmed by OpenFN employee. I gonna switch to the only way is writing automated tests and running that.
ok
Left to be done,
How can I test it manually?
@jeremi we can not, only testing using unittest code via pnpm
, and in term of unittest, I mean mocking test response from Odoo as well.
@nhatnm0612 will raise the PR today.
but @nhatnm0612 can we install it locally and run it (not automated tests)?
but @nhatnm0612 can we install it locally and run it (not automated tests)?
@jeremi no, it is confirmed by OpenFN employee
@nhatnm0612 will setup OpenFN on local to be utilized with OpenSPP repo.
@nhatnm0612 has raised a PR in the OpenFN repo. https://github.com/OpenFn/adaptors/pull/409
The methods mentioned in the description have been implemented.
@nhatnm0612 will list down the steps to setup on local.
steps for setting up local OpenFN:
After Pre-installed step, basically, you can boost up OpenFn Lightning with this command:
iex -S mix phx.server
Fixing the code of pulling adaptor at: https://github.com/OpenFn/Lightning/blob/c057048b56242613d05748a53b352ad0473fd552/lib/lightning/adaptor_registry.ex#L224
def fetch() do
start = DateTime.utc_now()
Logger.debug("Fetching adaptors from NPM.")
openfn_adapters =
Npm.user_packages("openfn")
|> Enum.map(fn {name, _} -> name end)
|> Enum.filter(fn name ->
Regex.match?(~r/@openfn\/language-\w+/, name)
end)
|> Enum.reject(fn name ->
name in @excluded_adaptors
end)
|> Task.async_stream(
&fetch_npm_details/1,
ordered: false,
max_concurrency: 10,
timeout: @timeout
)
|> Stream.map(fn {:ok, detail} -> detail end)
|> Enum.to_list()
result = openfn_adapters ++ [
%{
latest: "1.0.0",
name: "openspp",
repo: "git+https://github.com/nhatnm0612/adaptors/tree/add-openspp-adaptor",
versions: [%{version: "1.0.0"}]
}
]
diff = DateTime.utc_now() |> DateTime.diff(start, :millisecond)
# IO.inspect(result)
Logger.debug(fn -> "Finished fetching adaptors in #{diff}ms." end)
result
end
@dasunhegoda due to requests from OpenFN side, I need a rectangle image [png, 512*190px] of OpenSPP for the adaptor logos. [link]. Also, they asked me to create test jobs with OpenSPP sandbox server's credentials [link]
I made some changes last weekend and all the feedbacks are positive now except these 2.
@nhatnm0612 : You can use the logo on our web and resize it as per requirement. If additional help is required, Lit usually helps us with this. We can use the openspp demo env as the sandbox.
@nhatnm0612 ask Lit for it. He will prepare it for you.
Can you add the methods:
What is OpenFn?
Digital Public Good for workflow automation–a platform.
Video link explaining how OpenFN works
Official documentation
OpenFn v1 iPaaS will be used to integrate with OpenSPP.
registrant_id is from: https://github.com/OpenSPP/openspp-registry/issues/247
Implement the methods: