Skip to content

Commit

Permalink
REVERT ME: Debug Python validation test failure on remote.
Browse files Browse the repository at this point in the history
  • Loading branch information
petervdonovan committed Feb 7, 2022
1 parent 761499b commit bde16fb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 88 deletions.
61 changes: 1 addition & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,66 +16,7 @@ env:
vcpkgGitRef: 0bf3923f9fab4001c00f0f429682a0853b5749e0

jobs:
# Test the Maven build.
build:
uses: lf-lang/lingua-franca/.github/workflows/build.yml@master

# Run the unit tests.
unit-tests:
uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master

# Run tests for the standalone compiler.
cli-tests:
uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master

# Run the C benchmark tests.
c-benchmark-tests:
uses: lf-lang/lingua-franca/.github/workflows/benchmark-tests.yml@master
with:
target: 'C'

# Run tests for Eclipse.
eclipse-tests:
uses: lf-lang/lingua-franca/.github/workflows/eclipse-tests.yml@master

# Run language server tests.
lsp-tests:
uses: lf-lang/lingua-franca/.github/workflows/lsp-tests.yml@master

# Run the C integration tests.
c-tests:
uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@master

# Run the CCpp integration tests.
ccpp-tests:
uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@master
with:
use-cpp: true

# Run the C++ benchmark tests.
cpp-benchmark-tests:
uses: lf-lang/lingua-franca/.github/workflows/benchmark-tests.yml@master
with:
target: 'Cpp'

# Run the C++ integration tests.
cpp-tests:
uses: lf-lang/lingua-franca/.github/workflows/cpp-tests.yml@master

# Run the Python integration tests.
py-tests:
uses: lf-lang/lingua-franca/.github/workflows/py-tests.yml@master

# Run the Rust integration tests.
rs-tests:
uses: lf-lang/lingua-franca/.github/workflows/rs-tests.yml@master

# Run the Rust benchmark tests.
rs-benchmark-tests:
uses: lf-lang/lingua-franca/.github/workflows/benchmark-tests.yml@master
with:
target: 'Rust'

# Run the TypeScript integration tests.
ts-tests:
uses: lf-lang/lingua-franca/.github/workflows/ts-tests.yml@master
uses: lf-lang/lingua-franca/.github/workflows/lsp-tests.yml@scale-back-lsp-tests
23 changes: 3 additions & 20 deletions .github/workflows/lsp-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
run:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
# Uninstall operations are needed because the language server is able to use multiple
Expand All @@ -29,15 +29,6 @@ jobs:
uses: actions/[email protected]
with:
java-version: 11
- name: Setup Node.js environment
uses: actions/[email protected]
- name: Install pnpm
run: npm i -g pnpm
- name: Setup Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: nightly
components: clippy
- name: Install Dependencies Ubuntu
run: |
sudo apt-get install libprotobuf-dev protobuf-compiler libprotobuf-c-dev protobuf-c-compiler
Expand All @@ -61,18 +52,10 @@ jobs:
repository: lf-lang/lingua-franca
submodules: true
ref: ${{ inputs.compiler-ref }}
- name: Run language server Python tests without PyLint
run: ./gradlew test --tests org.lflang.tests.lsp.LspTests.pythonSyntaxOnlyValidationTest
- name: Report to CodeCov
uses: codecov/[email protected]
with:
file: org.lflang.tests/build/reports/xml/jacoco
fail_ci_if_error: false
verbose: true
- name: Install pylint
run: python3 -m pip install pylint
run: pip install pylint==2.11.1
- name: Run language server tests
run: ./gradlew clean test --tests org.lflang.tests.lsp.LspTests.*ValidationTest
run: ./gradlew clean test --tests org.lflang.tests.lsp.LspTests.pythonValidationTest
- name: Report to CodeCov
uses: codecov/[email protected]
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void write() throws IOException {
throw new IOException("Failed to create a swap file.");
}
try (PrintWriter writer = new PrintWriter(path.toFile())) {
lines.forEach(System.out::println); // DEBUG
lines.forEach(writer::println);
}
}
Expand Down
2 changes: 1 addition & 1 deletion org.lflang.tests/src/org/lflang/tests/lsp/LspTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void typescriptValidationTest() throws IOException {
* @param builder A builder for the error inserter that will be used.
*/
private void targetLanguageValidationTest(Target target, ErrorInserter.Builder builder) throws IOException {
long seed = new Random().nextLong();
long seed = 2943758407366436584L;
System.out.printf("Running validation tests for %s with random seed %d.%n", target.getDisplayName(), seed);
Random random = new Random(seed);
int i = SAMPLES_PER_CATEGORY_VALIDATION_TESTS;
Expand Down
10 changes: 4 additions & 6 deletions org.lflang/src/org/lflang/generator/python/PythonValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ public Strategy getOutputReportingStrategy() {
*
* @param lines The lines of output from the compiler.
* @param i The current index at which a message may start. Guaranteed to be less
* than
* {@code lines.length - 3}.
* than {@code lines.length - 3}.
* @return Whether an error message was reported.
*/
private boolean tryReportTypical(String[] lines, int i) {
Expand Down Expand Up @@ -243,22 +242,21 @@ public int getPriority() {
@Override
public LFCommand getCommand(Path generatedFile) {
return LFCommand.get(
"pylint",
List.of("--output-format=json", generatedFile.getFileName().toString()),
"python3",
List.of("-m", "pylint", "--output-format=json", generatedFile.getFileName().toString()),
true,
fileConfig.getSrcGenPath()
);
}

@Override
public Strategy getErrorReportingStrategy() {
return (a, b, c) -> {};
return (a, b, c) -> System.err.println(a);
}

@Override
public Strategy getOutputReportingStrategy() {
return (validationOutput, errorReporter, codeMaps) -> {
if (validationOutput.isBlank()) return;
try {
for (PylintMessage message : mapper.readValue(validationOutput, PylintMessage[].class)) {
if (shouldIgnore(message)) continue;
Expand Down
2 changes: 1 addition & 1 deletion test/Python/src/serialization/PersonProtocolBuffers.lf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ main reactor {
unpacked.ParseFromString(serialized_msg)

# Extract and print the unpacked message.
print("Name: ", unpacked.name)
undefined_name15291838("Name: ", unpacked.name)
=}
}

0 comments on commit bde16fb

Please sign in to comment.