OpenFn / OpenFn/adaptors

`primero` Unit tests are broken

Open
#96 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
24
Forks
41
Avg merge
3d 13h
Merged PRs (30d)
12

Description

There is something horribly weird going on in the Primero adaptor unit tests.

The describe.skip that's currently in there (which probably shouldn't be skipped by the way) appears to be skipping the whole file, not just that describe block. This is maybe a Mocha bug or something? Pretty weird.

Anyway, that skipped block is causing all other tests to be ignored and not to run.

If you actually run the tests, it turns out they're broken too. They rely on a get function which I think should actually live in common.http and isn't imported properly, and state.configuration isn't set to the adaptor breaks on execute and, well, its pretty rough in there.

I appreciate that there's an open question over automated testing in adaptors, but these tests were once written with good intent and it's probably worth spending a couple of hours to just refresh them.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Primero adaptor unit tests and run them to reproduce the skipped-file behavior and failures. Inspect the test's use of get, common.http, and state.configuration; done means the intended tests run and the broken setup and execution failures are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.