Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hyperskill/hs-test-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7
Choose a base ref
...
head repository: hyperskill/hs-test-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Dec 25, 2021

  1. Copy the full SHA
    c4f9f9f View commit details

Commits on Jan 14, 2022

  1. Treat KeyboardInterrupt as Error instead of UnexpectedError

    Vladimir Turov committed Jan 14, 2022
    Copy the full SHA
    4a0dcfa View commit details

Commits on Jan 21, 2022

  1. Don't process histogram data, use raw data instead

    Vladimir Turov committed Jan 21, 2022
    Copy the full SHA
    a3be610 View commit details

Commits on Jan 24, 2022

  1. Improve histograms detection

    Vladimir Turov committed Jan 24, 2022
    Copy the full SHA
    14874e0 View commit details
  2. Remove hist_series

    Vladimir Turov committed Jan 24, 2022
    Copy the full SHA
    c12c464 View commit details
  3. Small enhancement

    Vladimir Turov committed Jan 24, 2022
    Copy the full SHA
    3403ad5 View commit details
  4. Add one more test

    Vladimir Turov committed Jan 24, 2022
    Copy the full SHA
    626d760 View commit details
  5. Remove unnecessary condition

    Vladimir Turov committed Jan 24, 2022
    Copy the full SHA
    e6ed5a4 View commit details

Commits on Jan 26, 2022

  1. Correct pandas test

    Vladimir Turov committed Jan 26, 2022
    Copy the full SHA
    6b8a2aa View commit details
  2. Further simplify searching code

    Vladimir Turov committed Jan 26, 2022
    Copy the full SHA
    8682939 View commit details

Commits on Jan 27, 2022

  1. Support bash testing

    Vladimir Turov committed Jan 27, 2022
    Copy the full SHA
    6875610 View commit details
  2. Copy the full SHA
    b94a52b View commit details

Commits on Jan 28, 2022

  1. Bump version

    Vladimir Turov committed Jan 28, 2022
    Copy the full SHA
    940b443 View commit details

Commits on Jan 31, 2022

  1. Add more histogram tests

    Vladimir Turov committed Jan 31, 2022
    Copy the full SHA
    03f46a1 View commit details

Commits on Feb 1, 2022

  1. Improve testing bar graphs

    Vladimir Turov committed Feb 1, 2022
    Copy the full SHA
    d572d27 View commit details

Commits on Mar 3, 2022

  1. Add unittest support

    inuur committed Mar 3, 2022
    Copy the full SHA
    b76cb75 View commit details
  2. Remove duplicates from __dir__

    inuur committed Mar 3, 2022
    Copy the full SHA
    473aa51 View commit details

Commits on Mar 4, 2022

  1. Copy the full SHA
    54f8248 View commit details
  2. Copy the full SHA
    bde4bdb View commit details

Commits on Mar 7, 2022

  1. Copy the full SHA
    c739c02 View commit details

Commits on Mar 8, 2022

  1. Change arguments order

    inuur committed Mar 8, 2022
    Copy the full SHA
    7ffc9a3 View commit details

Commits on Mar 9, 2022

  1. StageTest args refactor

    inuur committed Mar 9, 2022
    Copy the full SHA
    330b6be View commit details
  2. Refactor

    inuur committed Mar 9, 2022
    Copy the full SHA
    956a5fd View commit details
  3. Refactor

    inuur committed Mar 9, 2022
    Copy the full SHA
    85e3161 View commit details

Commits on Mar 17, 2022

  1. Merge branch 'release'

    Vladimir Turov committed Mar 17, 2022
    Copy the full SHA
    f68aa89 View commit details

Commits on Mar 23, 2022

  1. SQL support

    inuur committed Mar 23, 2022
    Copy the full SHA
    1c03e3c View commit details
  2. Copy the full SHA
    16e93d3 View commit details

Commits on Apr 11, 2022

  1. Prepare to implement box testing

    Vladimir Turov committed Apr 11, 2022
    Copy the full SHA
    692e2c0 View commit details

Commits on Apr 19, 2022

  1. Add test classes

    inuur committed Apr 19, 2022
    Copy the full SHA
    c909c27 View commit details
  2. Backup project tests

    inuur committed Apr 19, 2022
    Copy the full SHA
    974cecc View commit details
  3. Copy the full SHA
    60ca5c0 View commit details
  4. Remove tested class

    inuur committed Apr 19, 2022
    Copy the full SHA
    e8deea2 View commit details
  5. Copy the full SHA
    9ab52dd View commit details

Commits on Apr 21, 2022

  1. move test classes

    inuur committed Apr 21, 2022
    Copy the full SHA
    569a2d2 View commit details
  2. fix running tests

    inuur committed Apr 21, 2022
    Copy the full SHA
    e5e013c View commit details
  3. fix tests

    inuur committed Apr 21, 2022
    Copy the full SHA
    4df3313 View commit details
  4. Copy the full SHA
    50f1a3d View commit details
  5. Fix initial idle wait

    Vladimir Turov committed Apr 21, 2022
    Copy the full SHA
    55015e4 View commit details

Commits on Apr 22, 2022

  1. fix running plot tests

    inuur committed Apr 22, 2022
    Copy the full SHA
    cc9335a View commit details
  2. fix imports

    inuur committed Apr 22, 2022
    Copy the full SHA
    6528897 View commit details
  3. SQL support

    inuur committed Apr 22, 2022
    Copy the full SHA
    fa1a87b View commit details
  4. SQL tests

    inuur committed Apr 22, 2022
    Copy the full SHA
    576c589 View commit details
  5. Refacor SQL testing

    inuur committed Apr 22, 2022
    Copy the full SHA
    a87c387 View commit details
  6. Add test into SQLRunner

    inuur committed Apr 22, 2022
    Copy the full SHA
    8c64645 View commit details
  7. SQL tear down impl

    inuur committed Apr 22, 2022
    Copy the full SHA
    ce6b54d View commit details
  8. Add execute method

    inuur committed Apr 22, 2022
    Copy the full SHA
    13ade29 View commit details
  9. Remove dialect from SQLTest

    inuur committed Apr 22, 2022
    Copy the full SHA
    b00ac1c View commit details
  10. Move SQL tests

    inuur committed Apr 22, 2022
    Copy the full SHA
    ba24131 View commit details
  11. Copy the full SHA
    0a40936 View commit details
  12. Copy the full SHA
    eea44f9 View commit details
Showing 605 changed files with 9,070 additions and 7,177 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.yml text eol=lf
*.yaml text eol=lf
*.py text eol=lf
*.toml text eol=lf
*.md text eol=lf
*.txt text eol=lf
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Task: [#HSPC-](https://vyahhi.myjetbrains.com/youtrack/issue/HSPC-)

**Reviewers**
- [ ] @

**Description**
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "00:00"
groups:
all-actions:
patterns: [ "*" ]

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
time: "00:00"
23 changes: 23 additions & 0 deletions .github/workflows/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Prepare environment'
description: 'Prepare environment'

inputs:
python-version:
description: 'Python version to use'
required: true

runs:
using: "composite"
steps:
- name: Install Poetry
run: pipx install poetry==$(head -n 1 .poetry-version)
shell: bash

- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: 'poetry'

- name: Install dependencies and package
run: poetry install --no-interaction --no-ansi
shell: bash
16 changes: 16 additions & 0 deletions .github/workflows/auto-author-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Auto Author Assign

on:
pull_request_target:
types: [ opened, reopened ]

permissions:
pull-requests: write

jobs:
assign-author:
runs-on: [self-hosted, small]
timeout-minutes: 30
if: ${{ !github.event.pull_request.assignee }}
steps:
- uses: toshimaru/auto-author-assign@v2.1.1
35 changes: 35 additions & 0 deletions .github/workflows/auto-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Format code
on:
pull_request:
push:
branches:
- master
- release

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
format_backend:
name: Format with ruff
runs-on: [ self-hosted, small ]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- uses: ./.github/workflows/actions/prepare

- run: poetry run ruff check --fix --unsafe-fixes --preview --exit-zero .
- run: poetry run ruff format .

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
fetch: false
default_author: github_actions
message: 'Backend: Auto format'
add: '.'
87 changes: 87 additions & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Build Wheels

on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
build_wheels:
name: Build psutil wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
include:
# Linux builds
- os: ubuntu-latest
python-version: '3.10'
- os: ubuntu-latest
python-version: '3.11'
- os: ubuntu-latest
python-version: '3.12'

# Windows builds
- os: windows-latest
python-version: '3.10'
- os: windows-latest
python-version: '3.11'
- os: windows-latest
python-version: '3.12'

# macOS builds
- os: macos-latest
python-version: '3.10'
- os: macos-latest
python-version: '3.11'
- os: macos-latest
python-version: '3.12'

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install build dependencies
run: |
python -m pip install pip wheel
shell: bash

- name: Build psutil wheel
run: |
# Create dist directory
mkdir -p dist
# Build psutil wheel
pip wheel psutil==5.8.0 --wheel-dir dist/
shell: bash

- name: Upload to GitHub Actions
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-py${{ matrix.python-version }}
path: dist/*

release:
needs: build_wheels
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: dist-*
path: dist
merge-multiple: true

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CI

on:
push:
branches:
- master
- release
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
lint:
name: Lint with ruff
runs-on: [ self-hosted, small ]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/prepare
with:
python-version: "3.11"
- name: Check files using the ruff formatter
run: poetry run ruff --fix --unsafe-fixes --preview .
shell: bash

mypy:
name: Static Type Checking
runs-on: [ self-hosted, small ]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/prepare
with:
python-version: "3.11"
- name: Mypy
run: poetry run mypy .
shell: bash

test:
name: Run unit test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Self-hosted runner
- os: [ self-hosted, small ]
python-version: "3.10"
- os: [ self-hosted, small ]
python-version: "3.11"
- os: [ self-hosted, small ]
python-version: "3.12"

# Windows
- os: windows-latest
python-version: "3.10.11"
- os: windows-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.12"

# macOS (arm64)
- os: macos-14
python-version: "3.11"
- os: macos-14
python-version: "3.12"
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/prepare
with:
python-version: ${{ matrix.python-version }}
- name: Run Tests
run: poetry run python tests/testing.py
shell: bash
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**__pycache__**
.idea
venv*
build/
/hs_test_python.egg-info/
node_modules
package-lock.json
1 change: 1 addition & 0 deletions .poetry-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.7.1
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10.13
18 changes: 14 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
FROM python:3.8.2-alpine3.11
FROM python:3.6-alpine3.15

RUN apk add --no-cache \
bash \
g++ \
gcc \
linux-headers

RUN pip install --no-cache-dir \
matplotlib \
seaborn \
pandas \
numpy

COPY . hs-test-python
RUN pip3 install --no-cache-dir ./hs-test-python

RUN apk add bash

WORKDIR /hs-test-python
ENV PYTHONPATH=.

CMD ["bin/bash"]
CMD ["bash"]
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
# hs-test-python

Python testing library for Hyperskill projects

It is a framework that simplifies testing educational projects for [Hyperskill](https://hyperskill.org).

It is required to use for Hyperskill projects. The main features are:
The main features are:
* black box testing
* multiple types of tests in a simple unified way (without stdin, with stdin, files, Django, Flask, Matplotlib)
* generating learner-friendly feedback (filtering stack-traces, hints)

## Installation

Install the package directly from GitHub:

```bash
pip install https://github.com/hyperskill/hs-test-python/archive/release.tar.gz
```

The package includes pre-built wheels for psutil, so you don't need a C++ compiler to install it.

## Development

To contribute to the project:

1. Clone the repository
2. Install dependencies with poetry:
```bash
poetry install
```

To learn how to use this library you can go here:
https://github.com/hyperskill/hs-test-python/wiki
Loading