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

Make improvements to test workbooks #849

Merged
merged 14 commits into from
Nov 21, 2023
Merged

Conversation

Jennit07
Copy link
Collaborator

@Jennit07 Jennit07 commented Oct 25, 2023

Opening as a draft PR for now to see changes. I have tested the episode file and happy it works as expected but having trouble with the individual file tests. I would like to test these before marking ready for review.

Test workbooks to check:

  • episode file
  • individual file
  • extracts
  • lookups

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Jennit07 Jennit07 marked this pull request as ready for review October 27, 2023 13:36
@github-actions

This comment has been minimized.

@Jennit07
Copy link
Collaborator Author

Okay, i've tested the workbooks and think im happy with the new set up. I've identified a few bugs along the way and fixed them on this branch. An overview of this:

Improvements:

  • new workbooks for sets of tests:
  • episode file tests workbook
  • individual file tests workbook
  • extract tests workbook
  • lookup tests workbook

Bugs:

  • Changed tests to use anon_chi when testing the episode/individual files. It was taking too long to test for chi using SLFhelper (this has now been fixed and PR waiting for review: Bug - speed up get_chi() slfhelper#68) Although slfhelper has been fixed i have left this to deal with anon_chi for faster processing!
  • Fixed a bug in get_source_extract_path which said it couldnt read the file in sourcedev. This was because year was in the format 1920 instead of 201920 in the file name.
  • A bug i thought we had fixed before was dealing with the variable hscp in tests. Basically, in the extract tests this looks for hscp but in the episode/individual file tests this looks for hscp2018 so it throwing an error. There was a fix in the function get_existing_data_for_tests but this would break either the extract tests or episode tests depending on which one you run. I have implemented a fix where this will rename the extracts to hscp2018 which will also match the episode/individual file tests.

Copy link
Collaborator

@SwiftySalmon SwiftySalmon left a 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! Will be much easier having tests split out that way.
What's going on with the hscp2018 changes - seems like a lot of repitition?

R/process_tests_acute.R Outdated Show resolved Hide resolved
@Jennit07 Jennit07 mentioned this pull request Nov 20, 2023
11 tasks

This comment has been minimized.

This comment has been minimized.

Copy link

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

Unrecognized words (3)

consulations
hri
SPSS

To accept these unrecognized words as correct, you could run the following commands

... in a clone of the [email protected]:Public-Health-Scotland/source-linkage-files.git repository
on the improve_tests branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/main/apply.pl' |
perl - 'https://github.com/Public-Health-Scotland/source-linkage-files/actions/runs/6931549268/attempts/1'

OR

To have the bot accept them for you, reply quoting the following line:
@check-spelling-bot apply updates.

Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionary

This includes both expected items (232) from .github/actions/spelling/expect.txt and unrecognized words (3)

Dictionary Entries Covers Uniquely
cspell:swift/src/swift.txt 53 2
cspell:k8s/dict/k8s.txt 153 1 1
cspell:csharp/csharp.txt 32 1
cspell:filetypes/filetypes.txt 264 1
cspell:npm/dict/npm.txt 302 1

Consider adding them (in .github/workflows/spelling.yml) for uses: check-spelling/check-spelling@main in its with:

      with:
        extra_dictionaries:
          cspell:swift/src/swift.txt
          cspell:k8s/dict/k8s.txt
          cspell:csharp/csharp.txt
          cspell:filetypes/filetypes.txt
          cspell:npm/dict/npm.txt

To stop checking additional dictionaries, add (in .github/workflows/spelling.yml) for uses: check-spelling/check-spelling@main in its with:

check_extra_dictionaries: ''
Errors (3)

See the 📂 files view, the 📜action log, or 📝 job summary for details.

❌ Errors Count
❌ forbidden-pattern 1
❌ ignored-expect-variant 13
ℹ️ no-newline-at-eof 1

See ❌ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@Jennit07
Copy link
Collaborator Author

Changes made to put rename hscp into a function

@SwiftySalmon SwiftySalmon self-requested a review November 21, 2023 15:56
@SwiftySalmon SwiftySalmon merged commit a2892eb into dec-update-23 Nov 21, 2023
11 of 12 checks passed
@SwiftySalmon SwiftySalmon deleted the improve_tests branch November 21, 2023 16:35
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