Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Varun Tandon
@varun-tandon

I added a new service to core.domain, and as a part of my testing, I am trying to create a new UserStatsModel.

I have imported the following from core.platform import models

and I have also imported the user model (along with some other models) like so

(user_models, collection_models, exploration_models, story_models,
 feedback_models, suggestion_models,
 email_models) = models.Registry.import_models([
    models.NAMES.user, models.NAMES.collection, models.NAMES.exploration,
    models.NAMES.story, models.NAMES.feedback, models.NAMES.suggestion,
    models.NAMES.email])

I then define a setUp function, and setup the UserStatsModel like so

# Setup for UserStatsModel.
        user_models.UserStatsModel(
            id=self.USER_ID_1,
            impact_score=self.USER_1_IMPACT_SCORE,
            total_plays=self.USER_1_TOTAL_PLAYS,
            average_ratings=self.USER_1_AVERAGE_RATINGS,
            num_ratings=self.USER_1_NUM_RATINGS,
            weekly_creator_stats_list=self.USER_1_WEEKLY_CREATOR_STATS_LIST
        ).put()

However, when I run python2 -m scripts.run_backend_tests --test_target="core.domain.takeout_processor_service_test", I get the following error:

======================================================================
ERROR: test_export_data_nontrivial (core.domain.takeout_processor_service_test.TakeoutProcessorServiceTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/varuntandon/opensource/oppia/core/domain/takeout_processor_service_test.py", line 84, in setUp
    weekly_creator_stats_list=self.USER_1_WEEKLY_CREATOR_STATS_LIST
  File "/Users/varuntandon/opensource/oppia_tools/google_appengine_1.9.67/google_appengine/google/appengine/ext/ndb/model.py", line 3458, in _put
    return self._put_async(**ctx_options).get_result()
  ... (Truncated because of character limit)
      rpc = apiproxy_stub_map.UserRPC(service_name, deadline, callback)
  File "/Users/varuntandon/opensource/oppia_tools/google_appengine_1.9.67/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 414, in __init__
    self.__rpc = CreateRPC(service, stubmap)
  File "/Users/varuntandon/opensource/oppia_tools/google_appengine_1.9.67/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 68, in CreateRPC
    assert stub, 'No api proxy found for service "%s"' % service
AssertionError: No api proxy found for service "datastore_v3"

Does anyone know why this might be happening? Thanks for the help! I can provide the full error log if needed, but I truncated it for now

Sean Lip
@seanlip
Does your setUp() method call the "super" setUp() method of the parent class?
Varun Tandon
@varun-tandon
It does not. The base is test_utils.GenericTestBase, is this what I am missing?
I'll try it and report back
Sean Lip
@seanlip
Your setUp() method should, in general, include a call to the superclass method (see other tests that define a custom setUp() function).
Otherwise the usual setUp() won't run because you're overriding it
Varun Tandon
@varun-tandon
I see, that makes sense. That resolved my issue. Thanks!
Varun Tandon
@varun-tandon

I'm asserting two dictionaries equal to each other; however, one of them has unicode formatted strings, and the other has non unicode strings (example below)

- {'collection_progress_data': {u'23': [u'exp_1']},
+ {u'collection_progress_data': {u'23': [u'exp_1']},
?  +

-  'collection_rights_data': {u'editable_collection_ids': ['23'],
+  u'collection_rights_data': {u'editable_collection_ids': [u'23'],
?  +                                                        +

-                             u'owned_collection_ids': ['23'],
+                              u'owned_collection_ids': [u'23'],
? +                                                      +

-                             u'viewable_collection_ids': ['23'],
+                              u'viewable_collection_ids': [u'23'],
? +                                                         +

-                             u'voiced_collection_ids': ['23']},
+                              u'voiced_collection_ids': [u'23']},
? +                                                       +

Is there a recommended way to handle this?

Sean Lip
@seanlip
Hi Varun -- I think @lilithxxx can give you advice on this!
(For now, my suggestion is to see what other files in the codebase do.)
(and follow them)
Rishav Chakraborty
@lilithxxx
@varun-tandon does your file contain a from __future__ import unicode_literals at the top of the file? Also can you send the code which does the assertions?
Prasad Deshmukh
@deshmukhprasad
Hi everyone, I am new to oppia and would like to start contributing. Can anyone suggest a issue for me.
Rishav Chakraborty
@lilithxxx
Hi @deshmukhprasad welcome! You can start with any good-first-issue here
Ankita Saxena
@ankita240796

Hi all,

The e2e navigation test are failing on most of the PRS. @nithusha21's PR oppia/oppia#7603 removes the failing test as a temporary fix to resolve this issue. So, please update your branches with develop to resolve this issue on your PRs. Sorry for the trouble.

Thanks!

Nishant Pandey
@nipan09
@bansalnitish I have a issue while writing e2e test for subject interest in preferences page. When I add a subject manually, it autosaves (since there is no button to Save or Update Info). However, when the script performs the same action (adding subject), and refreshes the page, the bio is not saved. Any suggestions how to solve this problem?
Abhith Krishna
@donosco98
Hi everyone, I'm new to Oppia and want to contribute. I signed up the CLA form and read the docs, can I start contributing
Rishabh Rawat
@Showtim3
@nipan09 carefully observe how does it 'autosaves', do you press enter? e2e test are supposed to be exactly doing what an end user would do..the exact same scenario so maybe you are not exactly mimicing the end user behaviour in the e2e tests.
@donosco98 Yeah sure, go to Oppia's wiki to understand the process better and search for issues in the issues tab that you think you can handle, use labels such as good first contribution or such.
Nishant Pandey
@nipan09
@Showtim3, you are correct, I am working on it. After updating the local repository, the local host is not working through the new script given. It gives a blank screen while running. Any idea why is it happening?
Nishant Pandey
@nipan09
For all the drop down options in preferences page (like preferred system languageoptions), can anyone tell me where are the data for the options stored? I am finding it difficult to get the html code.
Nishant Pandey
@nipan09
The local host for oppia is not running properly using the script given, any idea why is it happening?
audstav
@audstav
The start script isn't working for me either. I'm getting an IOError: Unable to open file. It's looking for the configparser.py file under pylint-1.9.4 folder, but this file is actually located in another folder: pylint-quotes-0.1.8 (under oppia_tools).
Sean Lip
@seanlip
That's odd -- it seems to be working for me. I'll try and look into it in a couple of hours. Just to check, what is the top commit when you run git log?
(I want to make sure your local branch is synced with the latest version of develop.)
audstav
@audstav
I see the top commit is by Vojta: Wipeout 2.3: Add deletion policy to remaining storage models (#7552)
Sean Lip
@seanlip
@audstav -- just to check, when you go into oppia_tools/pylint-1.9.4, there is no configparser.py file? Can you provide a directory listing for that folder?
audstav
@audstav
@seanlip - yes that's right - no configpaser.py file in that folder. Here is a listing of everything in the pylint-1.9.4 folder:
__pycache__                mccabe-0.6.1.dist-info
astroid                    mccabe.py
astroid-1.6.6.dist-info            pylint
bin                    pylint-1.9.4.dist-info
isort                    six-1.12.0.dist-info
isort-4.3.21.dist-info            six.py
lazy_object_proxy            wrapt
lazy_object_proxy-1.4.1.dist-info    wrapt-1.11.2.dist-info
Sean Lip
@seanlip
That's weird -- I seem to have some files you don't have, for some reason (backports, backports.functools_lru_cache-1.5.dist-info, concurrent, configparser-3.7.4.dist-info, enum, etc.).
Can you try deleting oppia_tools/pylint-1.9.4 and running the install script again? If it still ends up breaking then I'll add an exception for it.
@nipan09 Are you running into the same error as @audstav, and if so, is your directory listing the same as hers?
Also @audstav if you need a temporary workaround, you can probably just comment out the relevant lines in scripts/install_third_party_libs.py. But we should try to find the correct long-term solution.
audstav
@audstav
@seanlip This worked, I deleted oppia_tools/pylint-1.9.4 as suggested and this time the script ran successfully. Thanks!
btw the files you mentioned are all in my oppia_tools/pylint-quotes-0.1.8 folder (the name of one of them is different though - configparser-4.0.2.dist-info)
Sean Lip
@seanlip
Yeah, I think different libs depend on different versions of configparser
But yep -- glad to hear it worked! Thanks a lot for following up!
Kisekka David
@Genza999
Hey everyone, I am a new contributor on Oppia. I have a slight issue, for some reason, I cant add a label to my PR for an issue I am working on. Anyone to kindly help out.
Sandeep Dubey
@DubeySandeep
Hi @Genza999, I can do it for you! :) Let me know your PR #ID.
Kisekka David
@Genza999
Hey @DubeySandeep , PR ID is #7649
thanks @DubeySandeep
U8N WXD
@U8NWXD

In the current develop, I’m getting a 500 error when creating a user via the “sign in with google” menu bar option. The error occurs after choosing Log In to create the user. Here’s the server output:

INFO     2019-09-21 22:45:54,044 module.py:835] default: "GET /userinfohandler HTTP/1.1" 200 33
INFO     2019-09-21 22:45:56,034 module.py:835] default: "GET /url_handler?current_url=http:%2F%2Flocalhost:8181%2Fsplash HTTP/1.1" 200 95
INFO     2019-09-21 22:45:56,493 module.py:835] default: "GET /favicon.ico HTTP/1.1" 200 318
INFO     2019-09-21 22:45:58,052 base.py:436] Traceback (most recent call last):
  File "/Users/cs/Documents/Personal/Coding/Contributing/oppia/tmp/oppia_tools/google_appengine_1.9.67/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
  File "/Users/cs/Documents/Personal/Coding/Contributing/oppia/tmp/oppia/core/controllers/acl_decorators.py", line 1536, in test_login
    return handler(self, **kwargs)
  File "/Users/cs/Documents/Personal/Coding/Contributing/oppia/tmp/oppia/core/controllers/profile.py", line 256, in get
    self.render_template('signup-page.mainpage.html')
  File "/Users/cs/Documents/Personal/Coding/Contributing/oppia/tmp/oppia/core/controllers/base.py", line 350, in render_template
    self.jinja2_env.get_template(filepath).render(**values))
  File "/Users/cs/Documents/Personal/Coding/Contributing/oppia/tmp/oppia_tools/google_appengine_1.9.67/google_appengine/lib/jinja2-2.6/jinja2/environment.py", line 719, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/Users/cs/Documents/Personal/Coding/Contributing/oppia/tmp/oppia_tools/google_appengine_1.9.67/google_appengine/lib/jinja2-2.6/jinja2/environment.py", line 693, in _load_template
    template = self.loader.load(self, name, globals)
  File "/Users/cs/Documents/Personal/Coding/Contributing/oppia/tmp/oppia_tools/google_appengine_1.9.67/google_appengine/lib/jinja2-2.6/jinja2/loaders.py", line 115, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/Users/cs/Documents/Personal/Coding/Contributing/oppia/tmp/oppia_tools/google_appengine_1.9.67/google_appengine/lib/jinja2-2.6/jinja2/loaders.py", line 180, in get_source
    raise TemplateNotFound(template)
TemplateNotFound: signup-page.mainpage.html

Is anyone else seeing this?

Sean Lip
@seanlip
That's odd ... it works fine for me.
U8N WXD
@U8NWXD
Yes, that file does exist for me
Sean Lip
@seanlip
That's a bit strange. I'm afraid I'm not sure. Somehow your environment can't locate the file, it seems ...?
Sean Lip
@seanlip
Also does it serve other pages correctly? The mechanism used would be the same, in general...
U8N WXD
@U8NWXD
I get a similar error when trying to view /library, but not /about, /get_started, nor /teach#playbook.
Rajitha Warusavitarana
@rajitha1998
Screenshot from 2019-09-22 11-51-46.png
Hi I'm a new to opensource contribution and new to oppia , while i'm running the command python -m scripts.start
I get this error chmod: cannot operate on dangling symlink '/media/rajitha/ubuntu Data/opensource/oppia/.git/hooks/pre-commit'
Rishabh Rawat
@Showtim3
hey don't we use bash scripts/start.sh anymore?
Rajitha Warusavitarana
@rajitha1998

Hi I'm a new to opensource contribution and new to oppia , while i'm running the command python -m scripts.start
I get this error chmod: cannot operate on dangling symlink '/media/rajitha/ubuntu Data/opensource/oppia/.git/hooks/pre-commit'

Got this problem resolved by re-cloning & reinstalling the project