Coder Social home page Coder Social logo

Specify which test to run about cadasta-test HOT 7 CLOSED

cadasta avatar cadasta commented on August 22, 2024
Specify which test to run

from cadasta-test.

Comments (7)

shailysangwan avatar shailysangwan commented on August 22, 2024

Can I work on this?

from cadasta-test.

linzjax avatar linzjax commented on August 22, 2024

Hi @shailysangwan, you are welcome to work on this if you would like. If this is for an application, per our contribution guidelines we'll need to outline how you would approach this issue first. As a forewarning, this repo isn't as well monitored as cadasta-platform, so response time might be slower.

If it's not for an application, you can skip that step and go for it!

from cadasta-test.

shailysangwan avatar shailysangwan commented on August 22, 2024

@linzjax Thanks, this is for the application.
Are those guidelines specific to the first contribution or for all contributions?

from cadasta-test.

linzjax avatar linzjax commented on August 22, 2024

@shailysangwan They're for any contribution associated with an application for this round of Outreachy and GSoC. It allows us to work through the details of someone's approach in the early stages of their work, instead of at the PR stage. It also gives us a chance to see the way you approach problems.

from cadasta-test.

shailysangwan avatar shailysangwan commented on August 22, 2024

@linzjax I plan on using argparse to invoke tests depending on the command line arguments.

So, I think we will have to restructure the way test suites are formed, so as to keep a track of individual tests and category tests to support the requirement of this issue and make the code fit well for use with argparse.

The user executes run.py.
It imports the folder selenium_tests, which imports all categories through the import statements in __init.py__.
Those import statements import all test files in the respective category folders' __init.py__ files.

And in each of those test files is a list of test cases.

Do tell me if this looks acceptable.

run.py

import unittest
import selenium_tests

suite = {c: [] for c in getattr(selenium_tests, "categories")}

for c in suite:
	category = getattr(selenium_tests, c)
	for f in getattr(category, "files"):
		file = getattr(category, f)
		for t in getattr(file, "tests"):
			suite[c].append(unittest.TestLoader().loadTestsFromTestCase(getattr(file, t)))

for c in suite:
	unittest.TextTestRunner(verbosity=2).run(unittest.TestSuite(suite[c]))

from cadasta-test.

linzjax avatar linzjax commented on August 22, 2024

That seems reasonable to me. Go for it!

from cadasta-test.

seav avatar seav commented on August 22, 2024

Specifying tests can already be done in a limited manner using the script. See the docs for more information.

from cadasta-test.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.