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

G5V8DT-25913 Поддержка протокола WebSocket #1479

Merged
merged 31 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6d990fc
Поднятие версий com._1c.g5.v8.dt.form
vadimeg Aug 23, 2024
a83c564
Перевод таргета на 2024.2
Aug 27, 2024
a024586
Подъем версий в dt.bsl.comment
AlmazNasibullin Sep 4, 2024
451f8c5
G5V8DT-25485
MaksimDzyuba Sep 4, 2024
d60ef72
Merge pull request #1465 from 1C-Company/G5V8DT-25485
MaksimDzyuba Sep 4, 2024
f721fa6
Поднятие версий com.e1c.g5.v8.dt.cli.api (#1468)
dsavenko Sep 25, 2024
5c69eab
Исправление ошибок в сообщениях
vadimeg Oct 1, 2024
e140646
Поднятие версий com._1c.g5.v8.dt.ui.util
vadimeg Oct 8, 2024
5499dec
Исправление ошибок в сообщениях
vadimeg Oct 9, 2024
22c48c2
Merge pull request #1469 from 1C-Company/fix_validation_messages
vadimeg Oct 9, 2024
26bfa8d
Fix build.yml
MaksimDzyuba Oct 18, 2024
2300477
Merge branch 'edt-2024-2' of https://github.com/1C-Company/v8-code-st…
MaksimDzyuba Oct 18, 2024
af7a666
G5V8DT-25849 Нет переноса строки при создании новой области в модуле
Oct 23, 2024
5b0258d
Revert "G5V8DT-25849 Нет переноса строки при создании новой области в…
Oct 28, 2024
682ca5c
G5V8DT-25849 Нет переноса строки при создании новой области в модуле
Oct 28, 2024
827deb7
G5V8DT-24042 Починить все тесты, падающие в публичных плагинах (#1467)
MaksimDzyuba Oct 28, 2024
3e94dc2
Merge pull request #1475 from 1C-Company/G5V8DT-25849
MaksimDzyuba Oct 28, 2024
1749798
Исправлена версия зависимостей на theming.ui.util
Nov 6, 2024
108c117
G5V8DT-24085 DcsOutputParameters содержит несуществующие поля
Nov 25, 2024
ef241f2
G5V8DT-26116 При добавлении модулей излишне добавляется область
Nov 28, 2024
56009d6
Update build.yml
tretyakevich Nov 29, 2024
a3a940a
Update build.yml
tretyakevich Nov 29, 2024
196329c
Merge pull request #1477 from 1C-Company/G5V8DT-26116
MaksimDzyuba Nov 29, 2024
a9eacbd
Merge pull request #1476 from 1C-Company/G5V8DT-24085
MaksimDzyuba Dec 2, 2024
09b4df9
G5V8DT-25913 Поддержка протокола WebSocket
MaksimDzyuba Dec 5, 2024
81753c6
G5V8DT-25625 Повышение гибкости настройки индексов (#1478)
MaksimDzyuba Dec 18, 2024
e48708a
Merge remote-tracking branch 'origin/master' into edt-2024-2
MaksimDzyuba Dec 20, 2024
ddbf3bc
Merge remote-tracking branch 'origin/master' into edt-2024-2
AlmazNasibullin Dec 21, 2024
85ea2c9
Merge remote-tracking branch 'origin/edt-2024-2' into G5V8DT-25913
MaksimDzyuba Dec 23, 2024
c115cc6
Merge branch 'edt-2025-1' into G5V8DT-25913
MaksimDzyuba Dec 25, 2024
e76bb7e
Merge branch 'edt-2025-1' into G5V8DT-25913
MaksimDzyuba Dec 28, 2024
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
Prev Previous commit
Next Next commit
G5V8DT-24042 Починить все тесты, падающие в публичных плагинах (#1467)
* G5V8DT-24042 Починить все тесты, падающие в публичных плагинах

* G5V8DT-24042 fix build-ci

* G5V8DT-24042 Починить все тесты, падающие в публичных плагинах

* G5V8DT-24042 Починить все тесты, падающие в публичных плагинах

* G5V8DT-24042 Починить все тесты, падающие в публичных плагинах

* G5V8DT-24042: Запуск билда без ожидания всего WS

Для защиты от блокировки нескольких проектов во время ожидания

---------

Co-authored-by: Alexander Tretyakevich <alexander.tretyakevich@xored.com>
  • Loading branch information
MaksimDzyuba and Alexander Tretyakevich authored Oct 28, 2024
commit 827deb73a8232f80dbcbbc836bb4e7d983161b4a
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
run: |
Xvfb :5 -screen 0 1280x1024x8 -fbdir /tmp &
export DISPLAY=:5
mvn clean verify -PSDK,find-bugs -Dtycho.localArtifacts=ignore -B -V
mvn clean verify -PSDK,find-bugs -Dtycho.localArtifacts=ignore -Dtycho.p2.httptransport.type=JavaUrl -X -B -V 1C

- name: Cache SonarCloud packages
uses: actions/cache@v2
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI

on:
workflow_dispatch:
push:
branches:
- master
Expand All @@ -14,7 +15,7 @@ jobs:
name: Build
# This build will run on master,release/* push, local PR and PR from forks without label Analyze
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.event.repository.full_name || !contains(github.event.pull_request.labels.*.name, 'Analyze')
uses: 1C-company/v8-code-style/.github/workflows/build.yml@edt-2024-1
uses: 1C-company/v8-code-style/.github/workflows/build.yml@edt-2024-2
with:
analyze: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.event.repository.full_name }}
secrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.IStructuredSelection;
Expand Down Expand Up @@ -76,6 +77,8 @@ public class ModuleStructurePropertyPage

private Button createStrictTypesButton;

private Button openButton;

private CheckboxTableViewer checkBoxViewer;

private final Set<ModuleType> existTemplates = new HashSet<>();
Expand Down Expand Up @@ -292,7 +295,7 @@ private void addSecondSection(Composite parent)
checkBoxViewer.setInput(ModuleType.VALUES);

Composite buttonPanel = createDefaultComposite(composite);
Button openButton = new Button(buttonPanel, SWT.PUSH);
openButton = new Button(buttonPanel, SWT.PUSH);
openButton.setText(Messages.ModuleStructurePropertyPage_Open_template);
openButton.setToolTipText(Messages.ModuleStructurePropertyPage_Open_template_tooltip);
openButton.setEnabled(false);
Expand Down
3 changes: 2 additions & 1 deletion tests/com.e1c.v8codestyle.bsl.itests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Fragment-Host: com.e1c.v8codestyle.bsl;bundle-version="[0.7.0,0.8.0)"
Automatic-Module-Name: com.e1c.v8codestyle.md.itests
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Localization: fragment
Import-Package: com._1c.g5.v8.dt.core.naming;version="[7.0.0,8.0.0)",
Import-Package: com._1c.g5.v8.dt.core.lifecycle;version="[9.2.0,10.0.0)",
com._1c.g5.v8.dt.core.naming;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.core.platform;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.form.model;version="[12.0.0,13.0.0)",
com._1c.g5.v8.dt.md.naming;version="[5.1.0,6.0.0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,33 @@
import static org.junit.Assert.assertTrue;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.jobs.Job;
import org.junit.Before;
import org.junit.Ignore;

import com._1c.g5.v8.bm.core.IBmObject;
import com._1c.g5.v8.dt.bsl.model.Module;
import com._1c.g5.v8.dt.core.lifecycle.ProjectStopType;
import com._1c.g5.v8.dt.core.lifecycle.ServiceLifecycleJob;
import com._1c.g5.v8.dt.core.lifecycle.WorkspaceProjectStopRequest;
import com._1c.g5.v8.dt.core.platform.IDtProject;
import com._1c.g5.v8.dt.metadata.mdclass.CommonModule;
import com._1c.g5.v8.dt.testing.TestingProjectLifecycleSupport;
import com._1c.g5.v8.dt.validation.marker.Marker;
import com.e1c.g5.v8.dt.check.ICheck;
import com.e1c.g5.v8.dt.check.settings.CheckUid;
Expand Down Expand Up @@ -181,16 +190,6 @@ protected void updateModule(String pathToResource) throws Exception
{
IProject project = getProject().getWorkspaceProject();
IFile file = project.getFile(getModuleFileName());
boolean[] wasChanged = new boolean[1];
IResourceChangeListener listener = event -> {
if (event.getResource() == file
|| event.getDelta() != null && event.getDelta().findMember(file.getFullPath()) != null)
{
wasChanged[0] = true;
}
};
project.getWorkspace().addResourceChangeListener(listener, IResourceChangeEvent.POST_CHANGE);

try (InputStream in = getClass().getResourceAsStream(pathToResource))
{
if (file.exists())
Expand All @@ -202,15 +201,23 @@ protected void updateModule(String pathToResource) throws Exception
file.create(in, true, new NullProgressMonitor());
}
}
for (int i = 0; !wasChanged[0] && i < 4; i++)
ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);

// As well as AUTO_BUILD-family job is being scheduled synchronously
// So all we need is to wait for auto-build job is being finished
// And also a little protection from direct file changes (without Eclipse
// resource subsystem)
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
try
{
Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null);
}
catch (OperationCanceledException | InterruptedException e)
{
Thread.sleep(500);
throw new IllegalStateException("Cannot update file:" + file.toString(), e); //$NON-NLS-1$
}
testingWorkspace.waitForBuildCompletion();
project.getWorkspace().removeResourceChangeListener(listener);
waitForDD(getProject());
//after fixing the problem in EDT - delete it
Thread.sleep(5000);
}

/**
Expand Down Expand Up @@ -286,4 +293,72 @@ protected ICheck getCheckInstance()
}
return check;
}

/**
* Delete project in the workspace.
* @param project deleted project, cannot be <code>null</code>
* @throws CoreException if workspace clean up error occurred
*/
protected void cleanUpProject(IProject project) throws CoreException
{
// First of all we need to stop all DT projects to perform the most effective
// cleanup, without stray dependent projects restarts and so on
Collection<WorkspaceProjectStopRequest> stopRequests = new ArrayList<>();

IDtProject dtProject = dtProjectManager.getDtProject(project);
if (dtProject != null)
{
stopRequests.add(new WorkspaceProjectStopRequest(project, ProjectStopType.DELETE));
}

// Stopping projects in the right order
orchestrator.stopWorkspaceProjects(stopRequests, new NullProgressMonitor());

// Delete projects physically

try
{
project.delete(false, true, null);
TestingProjectLifecycleSupport.waitForProjectStop(project);
}
catch (Throwable e)
{
e.printStackTrace(System.err);
//nop
}

// Checking if there are critical failures during the shutdown of the project
try
{
// Force closing services that failed during the normal close
if (dtProject != null && orchestrator.isStarted(dtProject))
{
orchestrator.stopProject(dtProject, ProjectStopType.DELETE);
TestingProjectLifecycleSupport.waitForProjectStop(project);
}
}
catch (Throwable e)
{
//nop
}
try
{
testingWorkspace.getWorkspaceRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
}
catch (Throwable e)
{
e.printStackTrace(System.err);
}

try
{
Job.getJobManager().join(ServiceLifecycleJob.FAMILY, new NullProgressMonitor());
Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null);
}
catch (OperationCanceledException | InterruptedException e)
{
// Nothing
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import org.eclipse.core.runtime.Path;
import org.junit.Test;

import com._1c.g5.v8.dt.validation.marker.IExtraInfoKeys;
import com._1c.g5.v8.dt.validation.marker.Marker;
import com._1c.g5.v8.dt.validation.marker.StandardExtraInfo;
import com.e1c.v8codestyle.bsl.check.AccessibilityAtClientInObjectModuleCheck;

/**
Expand Down Expand Up @@ -62,26 +62,25 @@ public void testObjectModule() throws Exception
{
List<Marker> markers = getObjectModuleMarkers();
assertEquals(3, markers.size());

Marker marker = markers.get(0);
assertEquals("5", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
marker = markers.get(1);
assertEquals("10", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));

marker = markers.get(2);
assertEquals("2", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
List<Integer> errorLines = markers.stream()
.map(marker -> marker.getExtraInfo().get(StandardExtraInfo.TEXT_LINE))
.map(Integer.class::cast)
.sorted()
.collect(Collectors.toList());
assertEquals(List.of(2, 5, 10), errorLines);
}

@Test
public void testManagerModule() throws Exception
{
List<Marker> markers = getModuleMarkers();
assertEquals(2, markers.size());

Marker marker = markers.get(0);
assertEquals("2", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
marker = markers.get(1);
assertEquals("27", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
List<Integer> errorLines = markers.stream()
.map(marker -> marker.getExtraInfo().get(StandardExtraInfo.TEXT_LINE))
.map(Integer.class::cast)
.sorted()
.collect(Collectors.toList());
assertEquals(List.of(2, 27), errorLines);
}

private List<Marker> getObjectModuleMarkers()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import org.junit.Test;

import com._1c.g5.v8.dt.validation.marker.IExtraInfoKeys;
import com._1c.g5.v8.dt.validation.marker.Marker;
import com._1c.g5.v8.dt.validation.marker.StandardExtraInfo;
import com.e1c.v8codestyle.bsl.check.AttachableEventHandlerNameCheck;

/**
Expand Down Expand Up @@ -49,6 +49,6 @@ public void testAttachableEventHandlerName() throws Exception
List<Marker> markers = getModuleMarkers();
assertEquals(1, markers.size());
Marker marker = markers.get(0);
assertEquals("6", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
assertEquals(Integer.valueOf(6), marker.getExtraInfo().get(StandardExtraInfo.TEXT_LINE));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void testNotFoundTryAfterBegin() throws Exception
List<Marker> markers = getModuleMarkers();
assertEquals(1, markers.size());
Marker marker = markers.get(0);
assertEquals("The try operator was not found after calling begin transaction", marker.getMessage());
assertEquals(Messages.BeginTransactionCheck_Try_was_not_found_after_calling_begin, marker.getMessage());
}

@Test
Expand All @@ -58,6 +58,7 @@ public void testShouldBeNoExecutableCodebetweenBeginAndTry() throws Exception
List<Marker> markers = getModuleMarkers();
assertEquals(1, markers.size());
Marker marker = markers.get(0);
assertEquals("There should be no executable code between begin transaction and try", marker.getMessage());
assertEquals(Messages.BeginTransactionCheck_Executable_code_between_begin_transaction_and_try,
marker.getMessage());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import com._1c.g5.v8.dt.bsl.model.Pragma;
import com._1c.g5.v8.dt.core.platform.IDtProject;
import com._1c.g5.v8.dt.metadata.mdclass.CommonModule;
import com._1c.g5.v8.dt.validation.marker.IExtraInfoKeys;
import com._1c.g5.v8.dt.validation.marker.Marker;
import com._1c.g5.v8.dt.validation.marker.StandardExtraInfo;
import com.e1c.v8codestyle.bsl.check.CanonicalPragmaCheck;

/**
Expand Down Expand Up @@ -111,7 +111,7 @@ public void testCanonicalPragma() throws Exception
continue;
}

String uriToProblem = marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_URI_TO_PROBLEM_KEY);
String uriToProblem = marker.getExtraInfo().get(StandardExtraInfo.TEXT_URI_TO_PROBLEM);
assertTrue(uriErrors.contains(uriToProblem));
uriErrors.remove(uriToProblem);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import com._1c.g5.v8.dt.bsl.model.Pragma;
import com._1c.g5.v8.dt.core.platform.IDtProject;
import com._1c.g5.v8.dt.metadata.mdclass.CommonModule;
import com._1c.g5.v8.dt.validation.marker.IExtraInfoKeys;
import com._1c.g5.v8.dt.validation.marker.Marker;
import com._1c.g5.v8.dt.validation.marker.StandardExtraInfo;
import com.e1c.v8codestyle.bsl.check.ChangeAndValidateInsteadOfAroundCheck;

/**
Expand Down Expand Up @@ -104,11 +104,13 @@ public void testChangeAndValidateInsteadOfAround() throws Exception
continue;
}

String uriToProblem = marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_URI_TO_PROBLEM_KEY);
String uriToProblem = marker.getExtraInfo().get(StandardExtraInfo.TEXT_URI_TO_PROBLEM);
assertTrue(uriErrors.contains(uriToProblem));
uriErrors.remove(uriToProblem);
}

assertEquals(0, uriErrors.size());

cleanUpProject(dtProject.getWorkspaceProject());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import org.junit.Test;

import com._1c.g5.v8.dt.core.platform.IDtProject;
import com._1c.g5.v8.dt.validation.marker.IExtraInfoKeys;
import com._1c.g5.v8.dt.validation.marker.Marker;
import com._1c.g5.v8.dt.validation.marker.StandardExtraInfo;
import com.e1c.g5.v8.dt.check.settings.CheckUid;
import com.e1c.g5.v8.dt.check.settings.ICheckSettings;
import com.e1c.v8codestyle.bsl.check.CodeAfterAsyncCallCheck;
Expand Down Expand Up @@ -57,7 +57,7 @@ public void testCodeAfterExistence() throws Exception

Marker marker = getFirstMarker(CHECK_ID, getModuleId(), getProject());
assertNotNull(marker);
assertEquals("7", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
assertEquals(Integer.valueOf(7), marker.getExtraInfo().get(StandardExtraInfo.TEXT_LINE));
}

@Test
Expand Down Expand Up @@ -120,7 +120,7 @@ public void testSpreadsheetDocumentNonCompliant() throws Exception

Marker marker = getFirstMarker(CHECK_ID, getModuleId(), getProject());
assertNotNull(marker);
assertEquals("8", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
assertEquals(Integer.valueOf(8), marker.getExtraInfo().get(StandardExtraInfo.TEXT_LINE));
}

private void setParameterValue(Boolean value)
Expand Down
Loading