Skip to content

Port tests from bats to tape #282

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

Merged
merged 1 commit into from
Dec 3, 2018

Conversation

bweigel
Copy link
Contributor

@bweigel bweigel commented Nov 17, 2018

hi @dschep

I decided to split up and simplify PR #279 a little bit.
Started with porting some tests, which also helps towards resolutions of #269 ...

@bweigel
Copy link
Contributor Author

bweigel commented Nov 17, 2018

At least one test using the downloadCache option fails on Windows. However, this seems to be a runtime error during pip install ...:

Could not install packages due to an EnvironmentError: [Error 123] The filename, directory name, or volume label syntax is incorrect:
 'C\\:\\\\Users\\\\appveyor\\\\AppData\\\\Local\\\\UnitedIncome\\\\serverless-python-requirements\\\\Cache\\\\downloadCacheslspyc\\wheels\\76\\a0\\b4\\2a3ee1a32d0506931e558530258de1cc04b628eff1b2f008e0\\*.*'

Any ideas @AndrewFarley @dschep ?

Test output...
# py3.6 uses download cache with useDownloadCache option
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command requirements
Serverless: Load command requirements:clean
Serverless: Load command requirements:install
Serverless: Load command requirements:cleanCache
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Generated requirements from C:\projects\serverless-python-requirements\tests\base\requirements.txt in C:\projects\serverless-python-requirements\tests\base\.serverless\requirements.txt...
Serverless: Installing requirements from C:\projects\serverless-python-requirements\tests\base\.serverless\requirements\requirements.txt ...
Serverless: Using download cache directory C:\Users\appveyor\AppData\Local\UnitedIncome\serverless-python-requirements\Cache\downloadCacheslspyc
Collecting bottle (from -r C:/projects/serverless-python-requirements/tests/base/.serverless/requirements/requirements.txt (line 1))
 
  Error --------------------------------------------------
 
  null
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Stack Trace --------------------------------------------
 
Error: null
    at installRequirements (C:\projects\serverless-python-requirements\tests\base\node_modules\serverless-python-requirements\lib\pip.js:269:11)
    at installRequirementsIfNeeded (C:\projects\serverless-python-requirements\tests\base\node_modules\serverless-python-requirements\lib\pip.js:458:3)
    at ServerlessPythonRequirements.installAllRequirements (C:\projects\serverless-python-requirements\tests\base\node_modules\serverless-python-requirements\lib\pip.js:537:29)
From previous event:
    at PluginManager.invoke (C:\Users\appveyor\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:391:22)
    at PluginManager.run (C:\Users\appveyor\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:422:17)
    at variables.populateService.then.then (C:\Users\appveyor\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:157:33)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
    at Serverless.run (C:\Users\appveyor\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:144:8)
    at serverless.init.then (C:\Users\appveyor\AppData\Roaming\npm\node_modules\serverless\bin\serverless:44:28)
    at <anonymous>
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information -----------------------------
     OS:                     win32
     Node Version:           8.12.0
     Serverless Version:     1.33.1
 
Could not install packages due to an EnvironmentError: [Error 123] The filename, directory name, or volume label syntax is incorrect: 'C\\:\\\\Users\\\\appveyor\\\\AppData\\\\Local\\\\UnitedIncome\\\\serverless-python-requirements\\\\Cache\\\\downloadCacheslspyc\\wheels\\76\\a0\\b4\\2a3ee1a32d0506931e558530258de1cc04b628eff1b2f008e0\\*.*'
C:\projects\serverless-python-requirements\test.js:38
    throw new Error(`${cmd} failed with status code ${status}`);
    ^
Error: sls failed with status code 1
    at C:\projects\serverless-python-requirements\test.js:38:11
    at t (C:\projects\serverless-python-requirements\test.js:672:3)
    at Test.tape.test.t (C:\projects\serverless-python-requirements\test.js:76:7)
    at Test.bound [as _cb] (C:\projects\serverless-python-requirements\node_modules\tape\lib\test.js:76:32)
    at Test.run (C:\projects\serverless-python-requirements\node_modules\tape\lib\test.js:95:10)
    at Test.bound [as run] (C:\projects\serverless-python-requirements\node_modules\tape\lib\test.js:76:32)
    at Immediate.next [as _onImmediate] (C:\projects\serverless-python-requirements\node_modules\tape\lib\results.js:71:15)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)

@dschep
Copy link
Contributor

dschep commented Nov 21, 2018

Dude. HUUGGE thanks for tackling this!! I assume your'e still working on this? And don't worry about one or two test failures on windows, given that the windows tests up till this effor were pretty meaningless, i'm fine with them not passing 100% on windows.

@bweigel
Copy link
Contributor Author

bweigel commented Nov 24, 2018

Yes. I am still kind of at it.

@bweigel bweigel force-pushed the 269_port_tests_part1 branch from ca0d7f3 to 8bbc506 Compare November 24, 2018 14:52
@bweigel bweigel changed the title Port tests from bats to tape - Part1 Port tests from bats to tape Nov 24, 2018
@bweigel bweigel force-pushed the 269_port_tests_part1 branch from 90a8f79 to aef8d53 Compare November 24, 2018 15:28
@bweigel
Copy link
Contributor Author

bweigel commented Nov 24, 2018

Well @dschep , I guess this is it. All tests ported to tape. On windows a few fail. Quite a few are also skipped, because of missing docker and/or checks for unix file permissions.
I don't know how those should behave under win32

Cheers!

@bweigel bweigel force-pushed the 269_port_tests_part1 branch from aef8d53 to 97417fe Compare November 25, 2018 16:17
@dschep
Copy link
Contributor

dschep commented Nov 29, 2018

Fantastic!!! Could you rebase on master to resolve the conflict?

@bweigel bweigel force-pushed the 269_port_tests_part1 branch from 2862c0d to ed9a47f Compare November 29, 2018 20:48
@bweigel
Copy link
Contributor Author

bweigel commented Nov 29, 2018

I merged master again. Seems like all the failing windows tests pass now, thanks to your recent fixes.
However, weirdly two tests fail on circleci, which didn't previously and also don't fail locally on my computer.

I guess I'll have to investigate this later.

@dschep
Copy link
Contributor

dschep commented Nov 30, 2018

i'll take a look at those failing tests tomorrow

@bweigel bweigel force-pushed the 269_port_tests_part1 branch from c6f6e7c to 2ff4552 Compare December 1, 2018 23:39
- migrates tests from bats to tape
@bweigel bweigel force-pushed the 269_port_tests_part1 branch from 2ff4552 to 6dc1145 Compare December 1, 2018 23:46
@bweigel
Copy link
Contributor Author

bweigel commented Dec 2, 2018

I guess it must have been some kind of glitch with .egg-info-folders, which sometimes were packaged and sometimes not. This made the test kinda flaky. I just adjusted the tests to use the __main__.py (which is included with flask) for custom slim patterns. And this did the trick. Should be ready now :)

@dschep dschep merged commit d043045 into serverless:master Dec 3, 2018
miketheman added a commit to miketheman/serverless-python-requirements that referenced this pull request Feb 19, 2020
In serverless#282 the test suite was ported from BATS to TAPE.

Signed-off-by: Mike Fiedler <[email protected]>
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.

2 participants