Skip to content

Commit

Permalink
Merge pull request #697 from openwebwork/PG-2.17
Browse files Browse the repository at this point in the history
PG-2.17
  • Loading branch information
drgrice1 authored Jul 18, 2022
2 parents 1b0b5ec + 3ef38fe commit d242aab
Show file tree
Hide file tree
Showing 243 changed files with 44,712 additions and 2,663 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is a basic workflow to help you get started with Actions

name: Coverage

on:
push:
workflow_dispatch:

jobs:
code_coverage:
runs-on: ubuntu-latest
container: eltenedor/pg-no-ww:latest
steps:
- uses: actions/checkout@v2
- name: Adapt configuration and run tests
env:
HARNESS_PERL_SWITCHES: -MDevel::Cover
run: |
ln -s -t /opt/webwork/ `pwd`
prove -r t
- name: push coverage analysis
if: always()
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: cover -report codecov

11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
lib/chromatic/color
lib/chromatic/color
conf/pg_defaults.yml
*.bak
cover_db/

htdocs/package-lock.json
htdocs/node_modules
htdocs/static-assets.json
htdocs/**/*.min.js
htdocs/**/*.min.css
22 changes: 22 additions & 0 deletions .perltidyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# PBP .perltidyrc file
-l=120 # Max line width is 120 cols
-et=4 # Use tabs instead of spaces.
-i=4 # Indent level is 4 cols
-ci=4 # Continuation indent is 4 cols
-b # Write the file inline and create a .bak file
-vt=0 # Minimal vertical tightness
-cti=0 # No extra indentation for closing brackets
-pt=2 # Maximum parenthesis tightness
-bt=1 # Medium brace tightness
-sbt=1 # Medium square bracket tightness
-bbt=1 # Medium block brace tightness
-nsfs # No space before semicolons
-nolq # Don't outdent long quoted strings
-mbl=1 # Do not allow multiple empty lines
-ce # Cuddled else
-cb # Cuddled blocks
-nbbc # Do not add blank lines before full length comments
-nbot # No line break on ternary
-nlop # No logical padding (this causes mixed tabs and spaces)
-wn # Weld nested containers
-xci # Extended continuation indentation
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Online Homework Delivery System
Version 2.*

Copyright 2000-2018, The WeBWorK Project
Copyright 2000-2022, The WeBWorK Project
All rights reserved.

This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

http://webwork.maa.org/wiki/Category:Release_Notes

Copyright 2000-2017, The WeBWorK Project
Copyright 2000-2022, The WeBWorK Project
http://webwork.maa.org
All rights reserved.
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
#Welcome to WeBWorK
# Welcome to WeBWorK

![main workflow](https://github.com/pstaabp/pg/actions/workflows/coverage.yml/badge.svg)
[![codecov](https://codecov.io/gh/pstaabp/pg/branch/unit-test/graph/badge.svg?token=H7WYHBDB9S)](https://codecov.io/gh/pstaabp/pg)
![GitHub last commit](https://img.shields.io/github/last-commit/pstaabp/pg/unit-test)

WeBWorK is an open-source online homework system for math and sciences courses. WeBWorK is supported by the MAA and the NSF and comes with an Open Problem Library (OPL) of over 30,000 homework problems. Problems in the OPL target most lower division undergraduate math courses and some advanced courses. Supported courses include college algebra, discrete mathematics, probability and statistics, single and multivariable calculus, differential equations, linear algebra and complex analysis. Find out more at the main WeBWorK [webpage](http://webwork.maa.org).

## Information for Users

New users interested in getting started with their own WeBWorK server, or instructors looking to learn more about how to use WeBWorK in their classes, should take a look at one of the following resources:
* [WeBWorK wiki](http://webwork.maa.org/wiki/Main_Page) - The main WeBWorK wiki
* [Instructors](http://webwork.maa.org/wiki/Instructors) - Information for Instructors
* [Problem Authors](http://webwork.maa.org/wiki/Authors) - Information for Problem Authors
* [WW_Install](http://github.com/aubreyja/ww_install) - Information for using the WW_install script
* [Forum](http://webwork.maa.org/moodle/mod/forum/index.php?id=3) - The WeBWorK Forum
* [Frequently Asked Questions](https://github.com/openwebwork/webwork2/wiki/Frequently-Asked-Questions) - A list of frequently asked questions.
New users interested in getting started with their own WeBWorK server, or instructors looking to learn more about how to use WeBWorK in their classes, should take a look at one of the following resources:

* [WeBWorK wiki](http://webwork.maa.org/wiki/Main_Page) - The main WeBWorK wiki
* [Instructors](http://webwork.maa.org/wiki/Instructors) - Information for Instructors
* [Problem Authors](http://webwork.maa.org/wiki/Authors) - Information for Problem Authors
* [WW_Install](http://github.com/aubreyja/ww_install) - Information for using the WW_install script
* [Forum](http://webwork.maa.org/moodle/mod/forum/index.php?id=3) - The WeBWorK Forum
* [Frequently Asked Questions](https://github.com/openwebwork/webwork2/wiki/Frequently-Asked-Questions) - A list of frequently asked questions.

##Information For Developers
## Information For Developers

People interested in developing new features for WeBWorK should take a look at the following resources. People interested in developing new problems for WeBWorK should visit [Problem Authors](http://webwork.maa.org/wiki/Authors).
* [First Time Setup](https://github.com/openwebwork/webwork2/wiki/First-Time-Setup) - Setting up your clone of this github repo for the first time.
* [Coding and Workflow](https://github.com/openwebwork/webwork2/wiki/Coding-and-Workflow) - Our suggested workflow processes. Following this will make it much easier to get code accepted into the repo.
* [Creating Pull Requests](https://github.com/openwebwork/webwork2/wiki/Creating-Pull-Requests) - Instructions on how to submit a pull request.
* [More Information](https://github.com/openwebwork/webwork2/wiki/) - Our Github wiki has additional information for developers, including information about WeBWorK3.

* [First Time Setup](https://github.com/openwebwork/webwork2/wiki/First-Time-Setup) - Setting up your clone of this github repo for the first time.
* [Coding and Workflow](https://github.com/openwebwork/webwork2/wiki/Coding-and-Workflow) - Our suggested workflow processes. Following this will make it much easier to get code accepted into the repo.
* [Creating Pull Requests](https://github.com/openwebwork/webwork2/wiki/Creating-Pull-Requests) - Instructions on how to submit a pull request.
* [More Information](https://github.com/openwebwork/webwork2/wiki/) - Our Github wiki has additional information for developers, including information about WeBWorK3.
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$PG_VERSION ='2.16';
$PG_COPYRIGHT_YEARS = '1996-2021';
$PG_VERSION ='2.17';
$PG_COPYRIGHT_YEARS = '1996-2022';

1;
19 changes: 19 additions & 0 deletions conf/pg_defaults.dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file is loaded if PG is loaded without a webwork2 lib
#
# The following are configuration options that are needed by PG
# and are a slimmed down list from those of WEBWORK_ROOT/conf/defaults.config

options:
webworkDirs:
tmp: /tmp
externalPrograms:
curl: /usr/bin/curl
cp: /bin/cp
mv: /bin/mv
rm: /bin/rm
tar: /bin/tar
latex: /usr/bin/latex --no-shell-escape
pdflatex: /usr/bin/pdflatex --no-shell-escape
dvisvgm: /usr/bin/dvisvgm
pdf2svf: /usr/bin/pdf2svg
convert: /usr/bin/convert
63 changes: 63 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Docker Instructions

These are instructions to get the docker image running for running the unit tests in `/t`.

Note: You may need sudo privileges in order to run the commands starting with `docker ...`.

## Using the Image from Docker Hub

The following Docker command will execute the command `prove -r t` inside the Docker container from the image [`eltenedor/pg-no-ww:latest`](https://hub.docker.com/r/eltenedor/pg-no-ww).
Make sure to run the commands from your `pg` folder.
The first time, this may take a couple of minutes.

### Running the Test Suite

```bash
docker run -it --rm --name pg-unit-test -v `pwd`:/opt/webwork/pg -w /opt/webwork/pg eltenedor/pg-no-ww prove -r t
```

### Code Coverage

As above, run one of the following Docker commands from you `pg` folder.

#### HTML Output

This runs the command `cover -report html` in the Docker container.

```bash
docker run -it --rm --name pg-unit-test -v `pwd`:/opt/webwork/pg -w /opt/webwork/pg eltenedor/pg-no-ww cover -report html
```

Check the HTML output written to `./pg/cover_db/coverage.html`.

#### Publish Results to [`codecov.io`](https://about.codecov.io/)

```bash
docker run -it --rm --name pg-unit-test -v `pwd`:/opt/webwork/pg -w /opt/webwork/pg -e CODECOV_TOKEN=xxxx-xxxx-xxxx eltenedor/pg-no-ww cover -report codecov
```

Here, `CODECOV_TOKEN=xxxx-xxxx-xxxx` should be adapted to your actual [token](https://docs.codecov.com/docs/quick-start). It is passed to the docker container as argument to the `-e` option.

HTTP Code `200` means that the data was sent successfully to codecov and is availablle at [https://app.codecov.io/gh/pstaabp/pg](https://app.codecov.io/gh/pstaabp/pg)

### Using the Shell

You can also just open up the `bash` of the Docker container via

```bash
docker run -it --rm --name pg-unit-test -v `pwd`:/opt/webwork/pg -w /opt/webwork/pg eltenedor/pg-no-ww
```

At the prompt, just run the commands `prove -r t` and `cover -report html` as indicated above.

## Building the Docker Image Locally

Execute the following command from your `pg/docker` folder

```bash
docker build -t pg-no-ww -f pg-no-dww.Dockerfile
```

### Running the Test Suite Locally

Same as above for the image from Docker Hub. Just replace the name `eltenedor/pg-no-ww` by `pg-no-ww`.
28 changes: 28 additions & 0 deletions docker/pg-no-ww.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM perl:5.32
# set metadata
LABEL maintainer="[email protected]"
LABEL hub.docker.com="eltenedor/pg-no-ww"
# install needed perl modules
RUN cpanm -fi --notest \
Class::Accessor \
Date::Parse \
DateTime \
Devel::Cover \
Devel::Cover::Report::Codecov \
HTML::Entities \
HTML::TagParser \
JSON \
Test::Exception \
Tie::IxHash \
UUID::Tiny module \
YAML::XS
# create webwork environment
RUN mkdir -p /opt/webwork
# rename config file at startup
RUN echo "cp -f /opt/webwork/pg/conf/pg_defaults.yml.dist /opt/webwork/pg/conf/pg_defaults.yml" >> ~/.bashrc
WORKDIR /opt/webwork
ENV PG_ROOT /opt/webwork/pg
ENV WEBWORK_ROOT /opt/webwork/webwork2
ENV WEBWORK_TOPLEVEL /opt/webwork
ENV HARNESS_PERL_SWITCHES -MDevel::Cover
CMD ["/bin/bash"]
25 changes: 25 additions & 0 deletions docker/test-docker.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM perl:5.32
# install needed perl modules
RUN cpanm -fi --notest \
Class::Accessor \
Date::Parse \
DateTime \
Devel::Cover \
Devel::Cover::Report::Codecov \
HTML::Entities \
HTML::TagParser \
JSON \
Test::Exception \
Tie::IxHash \
UUID::Tiny module \
YAML::XS
# create webwork environment
RUN mkdir -p /opt/webwork
# rename config file at startup
# RUN echo "cp -f /opt/webwork/pg/conf/pg_defaults.yml.dist /opt/webwork/pg/conf/pg_defaults.yml" >> ~/.bashrc
WORKDIR /opt/webwork/pg
ENV PG_ROOT /opt/webwork/pg
# ENV WEBWORK_ROOT /opt/webwork/webwork2
# ENV WEBWORK_TOPLEVEL /opt/webwork
# ENV HARNESS_PERL_SWITCHES -MDevel::Cover
CMD ["/bin/bash"]
Loading

0 comments on commit d242aab

Please sign in to comment.