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

Testing & Validation #44

Open
AA-Turner opened this issue Jan 13, 2021 · 0 comments
Open

Testing & Validation #44

AA-Turner opened this issue Jan 13, 2021 · 0 comments

Comments

@AA-Turner
Copy link
Member

Creating an issue with relevant comments from the-scouts/compass-interface-core#1.

Narrative

In Compass, various user roles have access to members in their hierarchy, but different fields are visible, and the structure of the HTML can also vary.

Initially, this can be mitigated with (tightly scoped) try/except blocks, to suppress errors or return None. Longer term, we should consider documenting what we expect to find for a given role, and raising an error or warning if that is not visible (e.g. date of birth for an Administrator role, etc.).

We should also likely add a flag to supress or raise errors for use in production code -- open to dicussion on if it is how to supress errors, and how to communicate which errors have been supressed.

We should also start to test the code -- we can unit test some of the functions that don't integrate with Compass, but for the scraper classes we should try to do some sort of mocking/faking -- perhaps by saving various examples of the returned HTML and parameterising the personal data (invalid phone numbers, missing data etc.). For now, we should gather examples of member IDs where errors occour.

Errors examples:

I ... was encountering exceptions within the xpath queries ... when Compass permissions weren't rendering fields (i.e. Religion).

@rglss, the-scouts/compass-interface-core#1 (comment)

There's been multiple occasions that 'core' fields (email/address etc) are missing within the Compass record.

@rglss, the-scouts/compass-interface-core#1 (comment)

this now errors if the crawler doesn't get a DOB or Join Date (i.e. empty string or None returned from xpath)

@rglss, the-scouts/compass-interface-core#1 (comment)

I've also seen 'Unknown' for join dates

@rglss, the-scouts/compass-interface-core#1 (comment)

Testing comments

any 'proper' testing suite would involve all possible permissions groups etc etc.

I think perhaps useful though where errors have occured to save the response.content str (bytes), and with redaction of data we could use these in some form?

@AA-Turner, the-scouts/compass-interface-core#1 (comment)

Longer term, we should validate permission levels and what we expect to see.

seperating ... errors from Compass and errors caused by the library

@AA-Turner, the-scouts/compass-interface-core#1 (comment)

@AA-Turner AA-Turner pinned this issue Jan 13, 2021
@AA-Turner AA-Turner transferred this issue from the-scouts/compass-interface-core Nov 13, 2021
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

No branches or pull requests

1 participant