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

Implement testing #7

Open
banool opened this issue Oct 7, 2017 · 2 comments
Open

Implement testing #7

banool opened this issue Oct 7, 2017 · 2 comments

Comments

@banool
Copy link
Owner

banool commented Oct 7, 2017

Currently this has no tests, which is super not ideal. If I make a change to the way that the script finds the Lecture Recordings link for example, I want to make sure it doesn't break the script for any of the subjects for which I know it already works. For this we need tests.

Unit tests should just test small parts, but this is quite hard in such a variable environment. The LMS can change at any time, and I won't have access to the same subjects (or any, since I'm graduating) in the future. As such, it'd be nice to have access to a version of the LMS that won't change. The two most obvious ways to get this would be:

  1. Offline downloads of individual subjects in the LMS. The links in these pages would have to be changed to operate relative to the other offline files. This won't work for everything, like I don't think it'd work too well with the echocenter.
  2. Some sort of mirror of the LMS, where we take a clone of it and host it on our own server. This way we can control access. It could also get the latest version of the real LMS periodically, or only if it won't break any of the tests, which serves as a warning to say that the new LMS update will break the script in some way. This solution is probably not possible without cooperation from the uni.
  3. A login with persistent access to the LMS. This login would ideally have access to all of the subjects and never lose access to them. Much like 2, this is also very optimistic, considering that I imagine the uni would smash that "no" button.

I made a small attempt at setting up testing in the "testing" branch before giving up, having realised the numerous difficulties with setting it up. This is a big one.

@matomatical
Copy link

  1. seems really tricky since the LMS and the echo center are so dynamic. i imagine this would be a lot of work to set up, and once it was set up, it wouldn't protect against any breaking changes to the structure of the websites.
  2. seems waaaay too much work to do without official help, and it would probably be easier to get them to cooperate on 3...
  3. seems the only option to me... luckily, it's promising! even without official cooperation, all you need is a staff account (e.g. tutor account). A staff account will last longer than a student account (I think) and, importantly, it will retain access to subjects even after they have been deactivated for students. I believe with the right settings a staff account would be identical to a student account in terms of navigating the LMS for the purposes of finding and downloading lecture recordings.

@banool
Copy link
Owner Author

banool commented Dec 4, 2017

In regards to 3, I've tested the script as working with my staff account with the 2 subjects I was tutoring, so there is hope there. Testing would be really excellent, it's very easy to introduce breaking changes into this monolith of a script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants