Skip to content

Automated tests#269

Open
brabemi wants to merge 3 commits intomessa:stablefrom
brabemi:tests
Open

Automated tests#269
brabemi wants to merge 3 commits intomessa:stablefrom
brabemi:tests

Conversation

@brabemi
Copy link
Collaborator

@brabemi brabemi commented Feb 8, 2021

Automated test implementation
Screenshot from 2021-02-08 22-01-58

The tests are defined for each task

- id: handout01_00
  markdown: |
    Na hodině jsme se naučili pracovat s interaktivní Python konzolí. Zkus pomocí Pythonu vypočítat:
    3+(4+6)×8÷2−1 =
    (Závorky v Pythonu fungují jako v matematice)
  test_code_file_name: uloha.py
  test: |
    from uloha import inc
    import time
    def test_answer():
        assert inc(0) == 1
    def test_for():
        for n in range(100):
            assert inc(n) == n+1

Test API endpoint is AWS lambda (https://github.com/brabemi/courseware-pytester) behind REST API gateway. Lambda parameters are:

  • Runtime: Python 3.8
  • Handler: lambda_function.lambda_handler
  • memory: 128MB
  • timeout: 10s (subprocess.run inside lambda has ~4s overhead -> ~6s to run the tests)

The config file should contain

test_endpoint: https://mylambda.execute-api.eu-west-1.amazonaws.com/api/endpoint
test_api_key: myapikey

@brabemi brabemi changed the title Tests Automated tests Feb 8, 2021
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.

1 participant