hashar added a comment.

  A few things that are worth investigating and probably could use to be 
simplified.
  
  sudo
  ====
  
  The default is `sudo: false`, a few environments do have `sudo: require` when 
they have `dist: xenial`:
  
    include:
        - python: '2.7_with_system_site_packages'
          env: LANGUAGE=nb FAMILY=wikipedia PYSETUP_TEST_EXTRAS=1 
PYWIKIBOT_TEST_NO_RC=1
          dist: xenial
          sudo: required
          addons:
            apt:
              packages:
                - djvulibre-bin
                - graphviz
                - liblua5.1-0-dev
                - python-ipaddr
        - python: '3.7'
          env: LANGUAGE=de FAMILY=wikipedia
          dist: xenial
          sudo: required
        - python: '3.8-dev'
          env: LANGUAGE=test FAMILY=wikipedia PYWIKIBOT_SITE_ONLY=1
          dist: xenial
          sudo: required
      allow_failures:
        - python: '3.8-dev'
          env: LANGUAGE=test FAMILY=wikipedia PYWIKIBOT_SITE_ONLY=1
          dist: xenial
          sudo: required
  
  One sure thing, we can't right know support the env 
'2.7_with_system_site_packages' since the CI job do not have sudo access to 
install extra packages. For the others, I am not sure why sudo is required on 
xenial? Maybe to get python 3.7 or 3.8 dev to be installed?
  
  global env
  ==========
  
    env:
      global:
        - TEST_TIMEOUT=300
        - PYWIKIBOT_NO_L10N_TESTS=1
    
      matrix:
        - LANGUAGE=en FAMILY=wikipedia PYWIKIBOT_TEST_PROD_ONLY=1
        - LANGUAGE=zh FAMILY=wikisource PYSETUP_TEST_EXTRAS=1 
PYWIKIBOT_TEST_PROD_ONLY=1 PYWIKIBOT_TEST_NO_RC=1
  
  The global env matrix sets `LANGUAGE` and `FAMILY` but they are always set in 
the matrix below. I would drop them from the global and have the `script:` part 
to fail immediately when either is not set.
  
  `PYWIKIBOT_TEST_PROD_ONLY=1` is always set, could be moved up in 
`env.global`. Note the environment variable is only listed in 
`tests.aspects.py`:
  
    for data in cls.sites.values():
        if ('code' in data and data['code'] in ('test', 'mediawiki')
                and 'PYWIKIBOT_TEST_PROD_ONLY' in os.environ and not dry):
            raise unittest.SkipTest(
                'Site code "{}" and PYWIKIBOT_TEST_PROD_ONLY is set.'
                .format(data['code']))
  
  Which seems to indicate tests are skipped when they are marked with 
`code=test` or `code=mediawiki`. Seems to me the variable can be set when 
`LANGUAGE` is set to `test` or `mediawiki` instead of always setting it.
  
  The second global matrix sets `PYWIKIBOT_TEST_NO_RC=1`, seems to be set 
because the test suite does not accommodate for some customization made on 
sites.
  
  `PYSETUP_TEST_EXTRAS` seems to be a huge hack that affects the build a lot 
with a few hacks all other the place.
  
  script
  ======
  
  The super long yaml script is not convenient. It would be nicer to have all 
the logic extracted to a standalone file and just invoke that. Eg:
  
    script:
      - citestrunner.sh

TASK DETAIL
  https://phabricator.wikimedia.org/T186208

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: hashar
Cc: hashar, Liuxinyu970226, Legoktm, Framawiki, Dalba, Dvorapa, Magul, 
Aklapper, Xqt, pywikibot-bugs-list, Redabr4, Zanziii, Sadisticturd, 
NebulousIris, Wenyi, A.S.Kochergin, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, 
Liudvikas, mys_721tx, jayvdb, dduvall, Masti, Alchimista, Rxy, greg
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to