Skip to content
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

Add test generator #1722

Merged
merged 55 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
df48049
remove ngram
senekor Aug 28, 2023
00cd03d
fix clean_topics_vs_practices.py
senekor Aug 28, 2023
dc6d0a1
remove generate_tests
senekor Aug 28, 2023
42891bc
remove unnecessary tests
senekor Aug 28, 2023
9a6f470
add crate to de-/serialize the track config
senekor Aug 28, 2023
f6c1aca
delete random python script
senekor Aug 28, 2023
8020cff
remove windows specific documentation
senekor Aug 28, 2023
9be57b1
remove outdated documentation
senekor Aug 28, 2023
a82b279
move tooling and test scripts to dev/scripts
senekor Aug 28, 2023
4156158
delete exercise generation scripts
senekor Aug 28, 2023
3062e2a
update installation structions
senekor Aug 29, 2023
93d34b3
unify contributing documentation
senekor Aug 29, 2023
df5bc08
make shell scripts more robust
senekor Sep 2, 2023
e5e6555
replace shell script with a Rust test
senekor Sep 2, 2023
8b45c73
delete fetch_canonical_data
senekor Sep 2, 2023
fdfe1cf
replace another shell script with a Rust test
senekor Sep 2, 2023
fd7f090
remove editorconfig
senekor Sep 2, 2023
f2ecac4
update scripting guidelines
senekor Sep 2, 2023
58c96c3
cleanup README
senekor Sep 2, 2023
97a0212
enforce no trailing whitespace
senekor Sep 2, 2023
ed35a11
remove CI step now covered by tests
senekor Sep 3, 2023
89ea1cf
run markdownlint on more files
senekor Sep 3, 2023
7db467a
cleanup tests workflow
senekor Sep 3, 2023
f8d461c
improve snake_case script name test
senekor Sep 3, 2023
27f97ce
add Rust test for number of ignored tests
senekor Sep 3, 2023
4e4c338
run repository tests in CI
senekor Sep 3, 2023
95c6071
merge rust tooling into a single package
senekor Sep 4, 2023
8abb209
fix script references after rename
senekor Sep 4, 2023
b497264
include exercises in workspace for LSP support
senekor Sep 4, 2023
232117a
don't run tests for stubbed exercises in CI
senekor Sep 4, 2023
e837156
add deserialization for canoncial data
senekor Sep 4, 2023
5655b3e
automate adding new exercises to track config
senekor Sep 6, 2023
219abf9
Add problem-specifications as submodule
senekor Sep 9, 2023
5b2357b
remove implicit dependency on configlet cache
senekor Sep 9, 2023
dc81164
move scripts back into bin directory
senekor Sep 9, 2023
bd54f00
use convert_case crate for string case handling
senekor Sep 9, 2023
893388b
use configlet to generate some files
senekor Sep 9, 2023
4433f5c
generate exercise files
senekor Sep 9, 2023
4d9fc34
enable updating an exercise with the generator
senekor Sep 9, 2023
0d0ebaf
generate tests according to .meta/tests.toml
senekor Sep 9, 2023
b4376f3
generate test cases with Tera tempaltes
senekor Sep 9, 2023
615028e
update acronym exercise using test generator
senekor Sep 9, 2023
803d0bd
Merge remote-tracking branch 'origin' into auto-sync
senekor Sep 9, 2023
90c6878
fix CI
senekor Sep 9, 2023
9c1a954
fix CI again
senekor Sep 9, 2023
7b41e08
move contributing documentation
senekor Sep 10, 2023
963a340
steal beautiful README from python track
senekor Sep 10, 2023
eb98f1d
allow README.md to disobey markdownlint
senekor Sep 10, 2023
8cacd6b
fix trailing whitespace in README
senekor Sep 10, 2023
173f87d
generate correct function names in tests
senekor Sep 11, 2023
85f1202
generate test files in kebab-case
senekor Sep 11, 2023
5bf7df8
Merge remote-tracking branch 'origin/main' into auto-sync
senekor Sep 12, 2023
9b5c1e7
apply improved test template to acronym
senekor Sep 12, 2023
df6dc30
preserve property order with serde_json
senekor Sep 12, 2023
9a4a9e7
improve test template
senekor Sep 12, 2023
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
10 changes: 0 additions & 10 deletions .editorconfig

This file was deleted.

112 changes: 26 additions & 86 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,19 @@ name: CI
on:
push:
branches:
- main
- main
pull_request:
workflow_dispatch:
schedule:
# Weekly.
- cron: "0 0 * * 0"

jobs:
ensure-conventions:
name: Ensure conventions are followed
runs-on: ubuntu-latest

steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

- name: Ensure tool names are snake cased
run: ./bin/lint_tool_file_names.sh

- name: Ensure src/lib.rs files exist
run: ./_test/ensure_lib_src_rs_exist.sh

- name: Count ignores
run: ./_test/count_ignores.sh

- name: Check UUIDs
run: ./_test/check_uuids.sh

- name: Verify exercise difficulties
run: ./_test/verify_exercise_difficulties.sh

- name: Check exercises for authors
run: ./_test/check_exercises_for_authors.sh

- name: Ensure relevant files do not have trailing whitespace
run: ./bin/lint_trailing_spaces.sh

configlet:
name: configlet lint
runs-on: ubuntu-latest
senekor marked this conversation as resolved.
Show resolved Hide resolved

steps:
# Checks out default branch locally so that it is available to the scripts.
- name: Checkout main
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
ref: main

# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

Expand All @@ -68,10 +31,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout main
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
ref: main
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

Expand All @@ -80,35 +39,24 @@ jobs:

# stolen from https://raw.githubusercontent.com/exercism/github-actions/main/.github/workflows/shellcheck.yml
shellcheck:
name: shellcheck internal tooling lint
name: Run shellcheck on scripts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

- name: Run shellcheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
env:
SHELLCHECK_OPTS: -x -s bash -e SC2001 --norc

compilation:
name: Check compilation
runs-on: ubuntu-latest

strategy:
# Allows running the job multiple times with different configurations
matrix:
rust: ["stable", "beta"]
deny_warnings: ['', '1']

steps:
# Checks out main locally so that it is available to the scripts.
- name: Checkout main
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
ref: main

# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

Expand All @@ -117,19 +65,31 @@ jobs:
with:
toolchain: ${{ matrix.rust }}

# run scripts as steps
- name: Check exercises
env:
DENYWARNINGS: ${{ matrix.deny_warnings }}
run: ./_test/check_exercises.sh
continue-on-error: ${{ matrix.rust == 'beta' && matrix.deny_warnings == '1' }}
DENYWARNINGS: "1"
run: ./bin/check_exercises.sh

- name: Ensure stubs compile
env:
DENYWARNINGS: ${{ matrix.deny_warnings }}
run: ./_test/ensure_stubs_compile.sh
continue-on-error: ${{ matrix.rust == 'beta' && matrix.deny_warnings == '1' }}
DENYWARNINGS: "1"
run: ./bin/ensure_stubs_compile.sh

tests:
name: Run repository tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

- name: Setup toolchain
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
with:
toolchain: stable

- name: Run tests
run: cd rust-tooling && cargo test

rustformat:
name: Check Rust Formatting
Expand All @@ -144,11 +104,8 @@ jobs:
with:
toolchain: stable

- name: Rust Format Version
run: rustfmt --version

- name: Format
run: bin/format_exercises
run: ./bin/format_exercises.sh

- name: Diff
run: |
Expand All @@ -166,11 +123,6 @@ jobs:
rust: ["stable", "beta"]

steps:
- name: Checkout main
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
ref: main

- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

Expand All @@ -179,34 +131,22 @@ jobs:
with:
toolchain: ${{ matrix.rust }}

# Clippy already installed on Stable, but not Beta.
# So, we must install here.
- name: Install Clippy
run: rustup component add clippy

- name: Clippy tests
env:
CLIPPY: true
run: ./_test/check_exercises.sh
run: ./bin/check_exercises.sh

- name: Clippy stubs
env:
CLIPPY: true
run: ./_test/ensure_stubs_compile.sh
run: ./bin/ensure_stubs_compile.sh

nightly-compilation:
name: Check exercises on nightly (benchmark enabled)
runs-on: ubuntu-latest
continue-on-error: true # It's okay if the nightly job fails

steps:
# Checks out main locally so that it is available to the scripts.
- name: Checkout main
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
ref: main

# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

Expand All @@ -217,5 +157,5 @@ jobs:

- name: Check exercises
env:
BENCHMARK: '1'
run: ./_test/check_exercises.sh
BENCHMARK: "1"
run: ./bin/check_exercises.sh
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
.DS_Store
**/target
tmp
bin/configlet
bin/configlet.exe
bin/exercise
bin/exercise.exe
bin/generator-utils/ngram
bin/generator-utils/escape_double_quotes
/bin/configlet
exercises/*/*/Cargo.lock
exercises/*/*/clippy.log
canonical_data.json
.vscode
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "problem-specifications"]
path = problem-specifications
url = [email protected]:exercism/problem-specifications
Loading