comp426-2022-fall / assignments

This repository contains information about and links to assignment invites and
Creative Commons Zero v1.0 Universal
0 stars 3 forks source link

Exam question: Failing autograder, but passing when I test on my own #19

Open emmagoodrich opened 1 year ago

emmagoodrich commented 1 year ago

Failed workflow run URL

https://github.com/comp426-2022-fall/e02comp-emmagoodrich/actions/runs/3643827943/jobs/6152426110

Question

For 05 and 10, the autograder says it is not able to find my math.js file and database.js file, respectively. I have tested both using the prompts from the README files and they appear to be working just fine. I have read and reread the provided links and documentation for exports and tried every variation that is listed in those resources. I also tried shortening the file paths in the require statements (for example, require('./02/math.js')), but the tests do not work on my end if I do that. I am really not sure what else to do as I have looked through all of the class examples and provided links, and tried everything I can think to do.

Link to documentation

What should be happening?

The server.js modules should be getting the add function and database from 02 and 04, respectively, and using them appropriately.

Screenshots of your local test(s)

Screen Shot 2022-12-07 at 6 57 03 PM Screen Shot 2022-12-07 at 7 00 16 PM Screen Shot 2022-12-07 at 6 59 59 PM

Why do you think the autograder is failing? (BE SPECIFIC)

I think that I am exporting or requiring these modules incorrectly for the way that the autograder is configured. Since the tests work locally, but not in the autograder, I feel like there may be some disconnect that is causing my code to fail outside of my local server. For the add function in 02 and 10, the autograder for 02 is saying that math.add is not a function, so I am wondering if maybe I am exporting the whole module and it is not able to get to the function? However, since the add function works in my tests (top screenshot), I don't really see how that would be the case.

emmagoodrich commented 1 year ago

Well, I have tried absolutely everything I can think of, including deleting and reinstalling quite a few things (shown here https://www.freecodecamp.org/news/error-cannot-find-module-node-npm-error-solved/). Even if I cannot receive any credit back for the exam, I would still appreciate any tips or solutions so I can learn from this!