Skip to content

Update tests + CI, remove cruft, fix a bug #23

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 9 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .appveyor.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
paths-ignore:
- 'README.md'
branches:
- main
- master
pull_request:
paths-ignore:
- 'README.md'
branches:
- main
- master
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1'
- '1.6'
- 'nightly'
os:
- ubuntu-latest
arch:
- x64
- x86
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v1
with:
version: '1'
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
22 changes: 22 additions & 0 deletions .github/workflows/documenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Documenter
on:
# push:
# branches: [main, master]
# tags: [v*]
# pull_request:
# branches: [main, master]
workflow_dispatch:
jobs:
Documenter:
name: Documentation
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: 1.6
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-docdeploy@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # when run by tagbot
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.jl.*.cov
*.jl.mem
coverage
Manifest.toml
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

100 changes: 0 additions & 100 deletions Manifest.toml

This file was deleted.

16 changes: 12 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
name = "TestSetExtensions"
uuid = "98d24dd4-01ad-11ea-1b02-c9a08f80db04"
authors = []
version = "2.0.0"
authors = ["Spencer Russell", "Phillip Alday"]
version = "3.0.0"

[deps]
DeepDiffs = "ab62b9b5-e342-54a8-a765-a90f495de1a6"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
julia = "1"
Aqua = "0.8"
DeepDiffs = "1"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm glad DeepDiffs is still up and running! I haven't touched it in years.

Distributed = "<0.0.1, 1"
Logging = "<0.0.1, 1"
MetaTesting = "=0.1.0"
Suppressor = "0.2"
Test = "<0.0.1, 1"
julia = "1.6"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
MetaTesting = "9e32d19f-1e4f-477a-8631-b16c78aa0f56"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much do we gain from MetaTesting? It doesn't look like the EncasedTestSet type you're using here is documented. AFAICT it is supposed to isolate the wrapped tests, but we still end up wrapping them in try...catch blocks.

I'm not strongly opposed, if you think it makes things easier. I just want to make sure there's a good reason to add an additional dependency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It made some of the testing easier -- without MetaTesting, the blocks were even more of an mess. It's "just" a test dep, so it doesn't hurt most users.

I can also set the compat entry for MetaTesting to exact equality, since we are reaching into internals a bit.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good. just wanted to make sure. re: making the compat entry exact, I'd say it's not necessary, but is good to keep in mind if things break in the future.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, didn't check the rest of the new commits before commenting. I'm good with it either way.

Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"

[targets]
test = ["Suppressor", "Logging"]
test = ["Suppressor", "Logging", "MetaTesting", "Aqua"]
29 changes: 2 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# TestSetExtensions

[![Build Status](https://travis-ci.org/ssfrr/TestSetExtensions.jl.svg?branch=master)](https://travis-ci.org/ssfrr/TestSetExtensions.jl)
[![Build status](https://ci.appveyor.com/api/projects/status/79m2ru7o3upt86ds/branch/master?svg=true)](https://ci.appveyor.com/project/ssfrr/testsetextensions-jl/branch/master)
[![codecov.io](http://codecov.io/github/ssfrr/TestSetExtensions.jl/coverage.svg?branch=master)](http://codecov.io/github/ssfrr/TestSetExtensions.jl?branch=master)
[![CI](https://github.com/ssfrr/TestSetExtensions.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/ssfrr/TestSetExtensions.jl/actions/workflows/CI.yml)
[![codecov](https://codecov.io/gh/ssfrr/TestSetExtensions.jl/graph/badge.svg?token=OFJ613ESY8)](https://codecov.io/gh/ssfrr/TestSetExtensions.jl)

![TestSetExtensions example gif](http://ssfrr.github.io/TestSetExtensions.jl/ExtendedTestSet.gif)

Expand Down Expand Up @@ -31,27 +30,3 @@ end
### Diff output example

![After diff output](http://ssfrr.github.io/TestSetExtensions.jl/diff_after.png)

## `@includetests`
TestSetExtensions also provides a `@includetests` macro that makes it easy to selectively run your tests, for cases when your full test suite is large and you only need to run a subset of your tests to test a feature you're working on. The macro takes a list of test files, so you can pass it `ARGS` to allow the user to specify which tests to run from the command line.

```julia
using Compat.Test
using TestSetExtensions

@testset "All the tests" begin
@includetests ARGS
end
```

If the user doesn't provide any command-line arguments, this will look for any `*.jl` files in the same directory as the running file (usually `runtests.jl`) and `include` them. The user can also specify a list of test files:

```
$ julia test/runtests.jl footests bartests
```

Which will run `footests.jl` and `bartests.jl`.

`@includetests` will print out each test module name as it goes (here in combination with `ExtendedTestSet`):

![includetests output](http://ssfrr.github.io/TestSetExtensions.jl/includetests.png)
Loading