Skip to content

[WIP] optimize code and add tests - #22

Open
krishna-parajuli wants to merge 3 commits into
moest-np:mainfrom
krishna-parajuli:kp-optimize-code-and-add-tests
Open

[WIP] optimize code and add tests#22
krishna-parajuli wants to merge 3 commits into
moest-np:mainfrom
krishna-parajuli:kp-optimize-code-and-add-tests

Conversation

@krishna-parajuli

Copy link
Copy Markdown

No description provided.

@krishna-parajuli
krishna-parajuli marked this pull request as ready for review April 21, 2024 03:33
@krishna-parajuli krishna-parajuli changed the title [WIP] Kp optimize code and add tests [WIP] optimize code and add tests Apr 21, 2024
@horrormyth

Copy link
Copy Markdown
Contributor

Since it's WIP, it'd be great to use the pytest, the project intends to use pytest for testing @krishna-parajuli , there is now pytest config as well.

@krishna-parajuli
krishna-parajuli force-pushed the kp-optimize-code-and-add-tests branch from 542ff56 to 74ffb89 Compare April 22, 2024 06:51
@ashiishme

Copy link
Copy Markdown

@krishna-parajuli If possible, can you create a PR for the test configuration so that it can be merged and used by others?

@sapradhan

Copy link
Copy Markdown
Collaborator

@krishna-parajuli thank you for taking lead on writing tests but the changes so far seem to be very detailed unit tests. Can we focus on writing tests that test the functionality first? Please see my proposal in this comment - #11 (comment)

Please create a test framework that bootstraps running the code and makes the output available to test methods. We can then divide writing specific test cases per each requirement among other devs.

cc: @horrormyth

@horrormyth

Copy link
Copy Markdown
Contributor

@krishna-parajuli thank you for taking lead on writing tests but the changes so far seem to be very detailed unit tests. Can we focus on writing tests that test the functionality first? Please see my proposal in this comment - #11 (comment)

Please create a test framework that bootstraps running the code and makes the output available to test methods. We can then divide writing specific test cases per each requirement among other devs.

cc: @horrormyth

I agree with @sapradhan here, with a strong note that detailed unit tests for each function are necessary, the main reason being that these could be used elsewhere. We can argue that reusability is minimal in this project, but still, it would be good to go in that direction. Anyhow, for brevity, those functions could then be battle-tested from the main function that actually calls them with functionality/cases in mind. One advantage of this is that we don't necessarily need to provide expected fixtures for each of the functions; basically, whoever creates one writes the tests for it. The test sets of main/whatever_we_call should then cover all the intended test cases with the expected output that @sumanashrestha has mentioned and/or any corner cases. With that being said, and TLDR, it would be good to have the expected fixtures ready.

@samurato

samurato commented May 1, 2024

Copy link
Copy Markdown
Contributor

@horrormyth @ashiishme @krishna-parajuli @sapradhan I have raised a PR that tests the functionality of the program. here #89.
It would be nice to add a tests folder and add unit tests and other tests there so that every PR will do a Build and produce the report before merge for further request upto you guys.

tests
|---units
|--- smoke
|-- intgration 

Sample automated testing here.
https://github.com/samurato/center-randomize/actions/runs/8911951792/job/24474346754
its failing unit tests that ran 10 times as per the requirements student allocation per school in center has to be less than 200 .

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.

5 participants