Skip to content

Commit d242aab

Browse files
authored
Merge pull request #697 from openwebwork/PG-2.17
PG-2.17
2 parents 1b0b5ec + 3ef38fe commit d242aab

File tree

243 files changed

+44712
-2663
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+44712
-2663
lines changed

.github/workflows/coverage.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Coverage
4+
5+
on:
6+
push:
7+
workflow_dispatch:
8+
9+
jobs:
10+
code_coverage:
11+
runs-on: ubuntu-latest
12+
container: eltenedor/pg-no-ww:latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Adapt configuration and run tests
16+
env:
17+
HARNESS_PERL_SWITCHES: -MDevel::Cover
18+
run: |
19+
ln -s -t /opt/webwork/ `pwd`
20+
prove -r t
21+
- name: push coverage analysis
22+
if: always()
23+
env:
24+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
25+
run: cover -report codecov
26+

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
lib/chromatic/color
1+
lib/chromatic/color
2+
conf/pg_defaults.yml
3+
*.bak
4+
cover_db/
5+
6+
htdocs/package-lock.json
7+
htdocs/node_modules
8+
htdocs/static-assets.json
9+
htdocs/**/*.min.js
10+
htdocs/**/*.min.css

.perltidyrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# PBP .perltidyrc file
2+
-l=120 # Max line width is 120 cols
3+
-et=4 # Use tabs instead of spaces.
4+
-i=4 # Indent level is 4 cols
5+
-ci=4 # Continuation indent is 4 cols
6+
-b # Write the file inline and create a .bak file
7+
-vt=0 # Minimal vertical tightness
8+
-cti=0 # No extra indentation for closing brackets
9+
-pt=2 # Maximum parenthesis tightness
10+
-bt=1 # Medium brace tightness
11+
-sbt=1 # Medium square bracket tightness
12+
-bbt=1 # Medium block brace tightness
13+
-nsfs # No space before semicolons
14+
-nolq # Don't outdent long quoted strings
15+
-mbl=1 # Do not allow multiple empty lines
16+
-ce # Cuddled else
17+
-cb # Cuddled blocks
18+
-nbbc # Do not add blank lines before full length comments
19+
-nbot # No line break on ternary
20+
-nlop # No logical padding (this causes mixed tabs and spaces)
21+
-wn # Weld nested containers
22+
-xci # Extended continuation indentation

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Online Homework Delivery System
33
Version 2.*
44

5-
Copyright 2000-2018, The WeBWorK Project
5+
Copyright 2000-2022, The WeBWorK Project
66
All rights reserved.
77

88
This program is free software; you can redistribute it and/or modify

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

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

9-
Copyright 2000-2017, The WeBWorK Project
9+
Copyright 2000-2022, The WeBWorK Project
1010
http://webwork.maa.org
1111
All rights reserved.

README.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1-
#Welcome to WeBWorK
1+
# Welcome to WeBWorK
2+
3+
![main workflow](https://github.com/pstaabp/pg/actions/workflows/coverage.yml/badge.svg)
4+
[![codecov](https://codecov.io/gh/pstaabp/pg/branch/unit-test/graph/badge.svg?token=H7WYHBDB9S)](https://codecov.io/gh/pstaabp/pg)
5+
![GitHub last commit](https://img.shields.io/github/last-commit/pstaabp/pg/unit-test)
26

37
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).
48

59
## Information for Users
610

7-
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:
8-
* [WeBWorK wiki](http://webwork.maa.org/wiki/Main_Page) - The main WeBWorK wiki
9-
* [Instructors](http://webwork.maa.org/wiki/Instructors) - Information for Instructors
10-
* [Problem Authors](http://webwork.maa.org/wiki/Authors) - Information for Problem Authors
11-
* [WW_Install](http://github.com/aubreyja/ww_install) - Information for using the WW_install script
12-
* [Forum](http://webwork.maa.org/moodle/mod/forum/index.php?id=3) - The WeBWorK Forum
13-
* [Frequently Asked Questions](https://github.com/openwebwork/webwork2/wiki/Frequently-Asked-Questions) - A list of frequently asked questions.
11+
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:
12+
13+
* [WeBWorK wiki](http://webwork.maa.org/wiki/Main_Page) - The main WeBWorK wiki
14+
* [Instructors](http://webwork.maa.org/wiki/Instructors) - Information for Instructors
15+
* [Problem Authors](http://webwork.maa.org/wiki/Authors) - Information for Problem Authors
16+
* [WW_Install](http://github.com/aubreyja/ww_install) - Information for using the WW_install script
17+
* [Forum](http://webwork.maa.org/moodle/mod/forum/index.php?id=3) - The WeBWorK Forum
18+
* [Frequently Asked Questions](https://github.com/openwebwork/webwork2/wiki/Frequently-Asked-Questions) - A list of frequently asked questions.
1419

15-
##Information For Developers
20+
## Information For Developers
1621

1722
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).
18-
* [First Time Setup](https://github.com/openwebwork/webwork2/wiki/First-Time-Setup) - Setting up your clone of this github repo for the first time.
19-
* [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.
20-
* [Creating Pull Requests](https://github.com/openwebwork/webwork2/wiki/Creating-Pull-Requests) - Instructions on how to submit a pull request.
21-
* [More Information](https://github.com/openwebwork/webwork2/wiki/) - Our Github wiki has additional information for developers, including information about WeBWorK3.
23+
24+
* [First Time Setup](https://github.com/openwebwork/webwork2/wiki/First-Time-Setup) - Setting up your clone of this github repo for the first time.
25+
* [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.
26+
* [Creating Pull Requests](https://github.com/openwebwork/webwork2/wiki/Creating-Pull-Requests) - Instructions on how to submit a pull request.
27+
* [More Information](https://github.com/openwebwork/webwork2/wiki/) - Our Github wiki has additional information for developers, including information about WeBWorK3.

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$PG_VERSION ='2.16';
2-
$PG_COPYRIGHT_YEARS = '1996-2021';
1+
$PG_VERSION ='2.17';
2+
$PG_COPYRIGHT_YEARS = '1996-2022';
33

44
1;

conf/pg_defaults.dist.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file is loaded if PG is loaded without a webwork2 lib
2+
#
3+
# The following are configuration options that are needed by PG
4+
# and are a slimmed down list from those of WEBWORK_ROOT/conf/defaults.config
5+
6+
options:
7+
webworkDirs:
8+
tmp: /tmp
9+
externalPrograms:
10+
curl: /usr/bin/curl
11+
cp: /bin/cp
12+
mv: /bin/mv
13+
rm: /bin/rm
14+
tar: /bin/tar
15+
latex: /usr/bin/latex --no-shell-escape
16+
pdflatex: /usr/bin/pdflatex --no-shell-escape
17+
dvisvgm: /usr/bin/dvisvgm
18+
pdf2svf: /usr/bin/pdf2svg
19+
convert: /usr/bin/convert

docker/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Docker Instructions
2+
3+
These are instructions to get the docker image running for running the unit tests in `/t`.
4+
5+
Note: You may need sudo privileges in order to run the commands starting with `docker ...`.
6+
7+
## Using the Image from Docker Hub
8+
9+
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).
10+
Make sure to run the commands from your `pg` folder.
11+
The first time, this may take a couple of minutes.
12+
13+
### Running the Test Suite
14+
15+
```bash
16+
docker run -it --rm --name pg-unit-test -v `pwd`:/opt/webwork/pg -w /opt/webwork/pg eltenedor/pg-no-ww prove -r t
17+
```
18+
19+
### Code Coverage
20+
21+
As above, run one of the following Docker commands from you `pg` folder.
22+
23+
#### HTML Output
24+
25+
This runs the command `cover -report html` in the Docker container.
26+
27+
```bash
28+
docker run -it --rm --name pg-unit-test -v `pwd`:/opt/webwork/pg -w /opt/webwork/pg eltenedor/pg-no-ww cover -report html
29+
```
30+
31+
Check the HTML output written to `./pg/cover_db/coverage.html`.
32+
33+
#### Publish Results to [`codecov.io`](https://about.codecov.io/)
34+
35+
```bash
36+
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
37+
```
38+
39+
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.
40+
41+
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)
42+
43+
### Using the Shell
44+
45+
You can also just open up the `bash` of the Docker container via
46+
47+
```bash
48+
docker run -it --rm --name pg-unit-test -v `pwd`:/opt/webwork/pg -w /opt/webwork/pg eltenedor/pg-no-ww
49+
```
50+
51+
At the prompt, just run the commands `prove -r t` and `cover -report html` as indicated above.
52+
53+
## Building the Docker Image Locally
54+
55+
Execute the following command from your `pg/docker` folder
56+
57+
```bash
58+
docker build -t pg-no-ww -f pg-no-dww.Dockerfile
59+
```
60+
61+
### Running the Test Suite Locally
62+
63+
Same as above for the image from Docker Hub. Just replace the name `eltenedor/pg-no-ww` by `pg-no-ww`.

docker/pg-no-ww.Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM perl:5.32
2+
# set metadata
3+
LABEL maintainer="[email protected]"
4+
LABEL hub.docker.com="eltenedor/pg-no-ww"
5+
# install needed perl modules
6+
RUN cpanm -fi --notest \
7+
Class::Accessor \
8+
Date::Parse \
9+
DateTime \
10+
Devel::Cover \
11+
Devel::Cover::Report::Codecov \
12+
HTML::Entities \
13+
HTML::TagParser \
14+
JSON \
15+
Test::Exception \
16+
Tie::IxHash \
17+
UUID::Tiny module \
18+
YAML::XS
19+
# create webwork environment
20+
RUN mkdir -p /opt/webwork
21+
# rename config file at startup
22+
RUN echo "cp -f /opt/webwork/pg/conf/pg_defaults.yml.dist /opt/webwork/pg/conf/pg_defaults.yml" >> ~/.bashrc
23+
WORKDIR /opt/webwork
24+
ENV PG_ROOT /opt/webwork/pg
25+
ENV WEBWORK_ROOT /opt/webwork/webwork2
26+
ENV WEBWORK_TOPLEVEL /opt/webwork
27+
ENV HARNESS_PERL_SWITCHES -MDevel::Cover
28+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)