Skip to content

Ensure additional bot testing & general test-bots improvements #403

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

Closed
wants to merge 1 commit into from

Conversation

neiljp
Copy link
Contributor

@neiljp neiljp commented May 27, 2018

See #402 for reference, but:

  • Consistently name gameoffifteen as game_of_fifteen (based on existing bot testing requirements)
  • Enable testing of 3 bots by simply adding __init__.py files
  • Slightly modify 3 bots (twitpost, witai, chess) and add __init__.py to get them testing
  • Incrementally improve test discovery and style in test-bots

This should be easy to review, as most commits are small and many are independent.

The penultimate commit enables the updated test-bots to run cleanly for bots with no __init__.py, as currently (mistakenly!). This behavior can be modified later (and controlled at run-time with --error-on-no-init), but maintains current status until the last bot with tests but no __init__.py has their tests fully fixed - which the last commit starts to do.

NOTE: From "Use unused available_bots to discover tests" to "Detect absent __init__.py & optionally exit", merels will currently fail; this can easily be minimised with a rebase, but to avoid it entirely would require a little more work.

@timabbott
Copy link
Member

Merged all but the last commit.

@roberthoenig
Copy link
Collaborator

@neiljp in some commits paths hardcoded paths like

top_level = "zulip_bots/zulip_bots/bots/"

were used. I'm fairly confident they'll lead to tests breaking on Windows. While you're at it, can you normalize the paths. You could e.g. use

top_level = os.path.normpath("zulip_bots/zulip_bots/bots/")

@neiljp
Copy link
Contributor Author

neiljp commented May 28, 2018

@roberthoenig We use normpath in one place in the api repo, and run no automated tests on windows. Other than bug reports, how do we know what works? Is there some guide we can follow for this, that you can recommend?

Maybe we need automated testing on Windows, if we intend to support that?

@roberthoenig
Copy link
Collaborator

@neiljp Where we don't use normpath we probably use os.sep. Afaik, Travis doesn't support Windows builds. One CI service that does support Windows is AppVeyor. I don't know if it's worth setting it up, but opening an issue can't hurt.

I've been doing a lot of work on this repo from a Windows machine, so fortunately there shouldn't be many issues. But other than that, yes, only reports and careful staring can help, and linter rules.

@showell
Copy link
Contributor

showell commented May 30, 2018

@neiljp This LGTM but we seem to have a build failure. Can you investigate that and rebase as needed?

@neiljp
Copy link
Contributor Author

neiljp commented May 30, 2018

@showell The build failure is related to the merels bot tests actually running with that commit, which they may have been at some point (somehow), but are some ways from doing right now from what I can tell.

I can certainly investigate further but was unsure whether to delegate to the bot or tests author (@amanagr ? @Privisus ?).

@amanagr
Copy link
Member

amanagr commented May 30, 2018

An__init__ file was missing in the merels bot directory and hence the tests were not running until now. I can send a PR to fix it and then @neiljp can rebase.
EDIT:
I just read the first comment. 😄

@amanagr
Copy link
Member

amanagr commented May 30, 2018

The current test for merels is according to the previous implementation. The new implementation with the game handler will require a lot of changes in the tests. I will just make merels pass tests by removing the cases which don't work and require a complete workaround.
PS: I feel sorry that I overlooked this earlier.

Edit:
@neiljp I think it would be better if you leave out adding __inti__.py for merels as it needs completely new set of tests. You can create an issue for someone to do it if you cannot do it. Thanks for finding this. (I don't think I will be able to do this either now.)

@neiljp
Copy link
Contributor Author

neiljp commented Jun 9, 2018

@amanagr Could you add an issue such as "Rework and enable Merels tests" with your understanding of the situation? test-bots as it stands will just warn about a missing __init__.py file, or if run with -p (just merged) then excludes it explicitly in the script as it stands.

My feeling would be that if we have a separate issue to track this, we should be able to close this PR.

@amanagr
Copy link
Member

amanagr commented Jun 10, 2018

@neiljp created #433 for it.

@neiljp
Copy link
Contributor Author

neiljp commented Jun 10, 2018

Closed as per above, ie. pending #433.

@neiljp neiljp closed this Jun 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants